Enable block relay when pruning

This commit is contained in:
Suhas Daftuar 2015-05-15 17:07:11 -04:00
parent 0da6ae2dc3
commit ae6f957a62

View File

@ -2281,9 +2281,7 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) {
int nBlockEstimate = 0; int nBlockEstimate = 0;
if (fCheckpointsEnabled) if (fCheckpointsEnabled)
nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(chainParams.Checkpoints()); nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(chainParams.Checkpoints());
// Don't relay blocks if pruning -- could cause a peer to try to download, resulting {
// in a stalled download if the block file is pruned before the request.
if (nLocalServices & NODE_NETWORK) {
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate))