Browse Source

Self check after the last peer is removed

0.13
Pieter Wuille 9 years ago
parent
commit
0e24bbf679
  1. 7
      src/main.cpp

7
src/main.cpp

@ -338,6 +338,13 @@ void FinalizeNode(NodeId nodeid) { @@ -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.

Loading…
Cancel
Save