소스 검색

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.
tags/v0.15.1
Suhas Daftuar 3 년 전
부모
커밋
e2652002b6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      src/net_processing.cpp

+ 1
- 1
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;
}

Loading…
취소
저장