Merge #7482: [P2P] Ensure headers count is correct

301bc7b Update nQueuedValidatedHeaders after peer disconnection (Suhas Daftuar)
This commit is contained in:
Wladimir J. van der Laan 2016-02-09 08:54:06 +01:00
commit 3ffe4b241e
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 3 additions and 1 deletions

View File

@ -332,8 +332,10 @@ void FinalizeNode(NodeId nodeid) {
AddressCurrentlyConnected(state->address);
}
BOOST_FOREACH(const QueuedBlock& entry, state->vBlocksInFlight)
BOOST_FOREACH(const QueuedBlock& entry, state->vBlocksInFlight) {
nQueuedValidatedHeaders -= entry.fValidatedHeaders;
mapBlocksInFlight.erase(entry.hash);
}
EraseOrphansFor(nodeid);
nPreferredDownload -= state->fPreferredDownload;