Skip to content

Commit

Permalink
Self check after the last peer is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Apr 7, 2016
1 parent 2d1d658 commit 0e24bbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,13 @@ void FinalizeNode(NodeId nodeid) {
assert(nPeersWithValidatedDownloads >= 0);

mapNodeState.erase(nodeid);

if (mapNodeState.empty()) {
// Do a consistency check after the last peer is removed.
assert(mapBlocksInFlight.empty());
assert(nPreferredDownload == 0);
assert(nPeersWithValidatedDownloads == 0);
}
}

// Requires cs_main.
Expand Down

0 comments on commit 0e24bbf

Please sign in to comment.