forked from premiere/premiere-libtorrent
added some invariant checks to bt_peer_connection
This commit is contained in:
parent
ea1043a293
commit
1c63a0e032
|
@ -3035,6 +3035,17 @@ namespace libtorrent
|
|||
#ifdef TORRENT_DEBUG
|
||||
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
|
||||
TORRENT_ASSERT( (bool(m_state != read_pe_dhkey) || m_dh_key_exchange.get())
|
||||
|| !is_local());
|
||||
|
|
Loading…
Reference in New Issue