From de047149534b667dee51f3ed58baee08577232f7 Mon Sep 17 00:00:00 2001 From: arkpar Date: Sun, 19 Jul 2015 23:36:57 +0200 Subject: [PATCH] comments --- libethereum/BlockChainSync.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libethereum/BlockChainSync.cpp b/libethereum/BlockChainSync.cpp index 6cf84b588..f0c183254 100644 --- a/libethereum/BlockChainSync.cpp +++ b/libethereum/BlockChainSync.cpp @@ -648,7 +648,8 @@ void PV60Sync::noteDoneBlocks(std::shared_ptr _peer, bool _clemenc clog(NetNote) << "Chain download failed. Aborted while incomplete."; else { - // Done our chain-get. + // This can happen when the leading peer aborts and the one that is selected instead does not have all the blocks. + // Just stop syncing to this peer. Sync will restart if there are no more peers to sync with. clog(NetNote) << "Peer does not have required blocks"; resetNeedsSyncing(_peer); } @@ -966,6 +967,7 @@ void PV61Sync::completeSubchain(std::shared_ptr _peer, unsigned _n { //Done chain-get m_syncingNeededBlocks.clear(); + // Add hashes to download skipping onces that are already downloaded for (auto h = m_completeChainMap.rbegin(); h != m_completeChainMap.rend(); ++h) if (!host().chain().isKnown(h->second.hashes.front()) && !host().chain().isKnown(h->second.hashes.back())) {