|
|
@ -845,7 +845,7 @@ void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CB |
|
|
|
// Relay inventory, but don't relay old inventory during initial block download.
|
|
|
|
// Relay inventory, but don't relay old inventory during initial block download.
|
|
|
|
connman->ForEachNode([nNewHeight, &vHashes](CNode* pnode) { |
|
|
|
connman->ForEachNode([nNewHeight, &vHashes](CNode* pnode) { |
|
|
|
if (nNewHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 0)) { |
|
|
|
if (nNewHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 0)) { |
|
|
|
BOOST_REVERSE_FOREACH(const uint256& hash, vHashes) { |
|
|
|
for (const uint256& hash : reverse_iterate(vHashes)) { |
|
|
|
pnode->PushBlockHash(hash); |
|
|
|
pnode->PushBlockHash(hash); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -2356,7 +2356,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
std::vector<CInv> vGetData; |
|
|
|
std::vector<CInv> vGetData; |
|
|
|
// Download as much as possible, from earliest to latest.
|
|
|
|
// Download as much as possible, from earliest to latest.
|
|
|
|
BOOST_REVERSE_FOREACH(const CBlockIndex *pindex, vToFetch) { |
|
|
|
for (const CBlockIndex *pindex : reverse_iterate(vToFetch)) { |
|
|
|
if (nodestate->nBlocksInFlight >= MAX_BLOCKS_IN_TRANSIT_PER_PEER) { |
|
|
|
if (nodestate->nBlocksInFlight >= MAX_BLOCKS_IN_TRANSIT_PER_PEER) { |
|
|
|
// Can't download any more from this peer
|
|
|
|
// Can't download any more from this peer
|
|
|
|
break; |
|
|
|
break; |
|
|
|