aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@chaincode.com>2017-05-05 14:37:01 -0400
committerSuhas Daftuar <sdaftuar@gmail.com>2017-05-08 14:27:04 -0400
commite2652002b6011f793185d473f87f1730c625593b (patch)
tree3d5f276189e3530e522eb4f7e432d47a8a688a75 /src/net_processing.cpp
parent6a796b2b53fe542e0f340f250f4f20d69efed8d0 (diff)
downloadbitcoin-e2652002b6011f793185d473f87f1730c625593b.tar.xz
Delay parallel block download until chain has sufficient work
nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 4d924b5cdb..e4d8d62a28 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -480,7 +480,7 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<con
// Make sure pindexBestKnownBlock is up to date, we'll need it.
ProcessBlockAvailability(nodeid);
- if (state->pindexBestKnownBlock == NULL || state->pindexBestKnownBlock->nChainWork < chainActive.Tip()->nChainWork) {
+ if (state->pindexBestKnownBlock == NULL || state->pindexBestKnownBlock->nChainWork < chainActive.Tip()->nChainWork || state->pindexBestKnownBlock->nChainWork < UintToArith256(consensusParams.nMinimumChainWork)) {
// This peer has nothing interesting.
return;
}