diff options
author | Suhas Daftuar <sdaftuar@chaincode.com> | 2017-05-05 14:37:01 -0400 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2017-05-08 14:27:04 -0400 |
commit | e2652002b6011f793185d473f87f1730c625593b (patch) | |
tree | 3d5f276189e3530e522eb4f7e432d47a8a688a75 | |
parent | 6a796b2b53fe542e0f340f250f4f20d69efed8d0 (diff) |
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.
-rw-r--r-- | src/net_processing.cpp | 2 |
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; } |