diff options
| author | Suhas Daftuar <[email protected]> | 2017-05-05 14:37:01 -0400 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2017-05-08 14:27:04 -0400 |
| commit | e2652002b6011f793185d473f87f1730c625593b (patch) | |
| tree | 3d5f276189e3530e522eb4f7e432d47a8a688a75 /src/net_processing.cpp | |
| parent | Merge #10342: [tests] Improve mempool_persist test (diff) | |
| download | discoin-e2652002b6011f793185d473f87f1730c625593b.tar.xz discoin-e2652002b6011f793185d473f87f1730c625593b.zip | |
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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 4d924b5cd..e4d8d62a2 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; } |