added some invariant checks to bt_peer_connection
This commit is contained in:
@@ -3035,6 +3035,17 @@ namespace libtorrent
|
|||||||
#ifdef TORRENT_DEBUG
|
#ifdef TORRENT_DEBUG
|
||||||
void bt_peer_connection::check_invariant() const
|
void bt_peer_connection::check_invariant() const
|
||||||
{
|
{
|
||||||
|
boost::shared_ptr<torrent> t = associated_torrent().lock();
|
||||||
|
|
||||||
|
if (!m_disconnect_started && m_initialized)
|
||||||
|
{
|
||||||
|
// none of this matters if we're disconnecting anyway
|
||||||
|
if (t->is_finished())
|
||||||
|
TORRENT_ASSERT(!is_interesting());
|
||||||
|
if (is_seed())
|
||||||
|
TORRENT_ASSERT(upload_only());
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_ENCRYPTION
|
#ifndef TORRENT_DISABLE_ENCRYPTION
|
||||||
TORRENT_ASSERT( (bool(m_state != read_pe_dhkey) || m_dh_key_exchange.get())
|
TORRENT_ASSERT( (bool(m_state != read_pe_dhkey) || m_dh_key_exchange.get())
|
||||||
|| !is_local());
|
|| !is_local());
|
||||||
|
Reference in New Issue
Block a user