From 31cae31ccc7bebbf82c01e2058a2abaceddaeaf3 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 30 May 2009 04:27:26 +0000 Subject: [PATCH] fix invariant check failure --- src/peer_connection.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 3e5fbb1a4..160ed6af0 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1329,6 +1329,14 @@ namespace libtorrent m_have_piece.set_bit(index); ++m_num_pieces; + if (is_seed()) + { + m_peer_info->seed = true; + m_upload_only = true; + disconnect_if_redundant(); + if (is_disconnecting()) return; + } + // only update the piece_picker if // we have the metadata and if // we're not a seed (in which case @@ -1371,14 +1379,6 @@ namespace libtorrent p->superseed_piece(t->get_piece_to_super_seed(p->get_bitfield())); } } - - if (is_seed()) - { - m_peer_info->seed = true; - m_upload_only = true; - disconnect_if_redundant(); - if (is_disconnecting()) return; - } } }