From 9168920275859285898c844f94a6b55e726b6db2 Mon Sep 17 00:00:00 2001 From: nzsquirrell Date: Sat, 18 Jun 2016 16:39:58 +1200 Subject: [PATCH] Revert "fix bug in initial-block-headers download" This reverts commit f122abfe3d86f46c0636b5d820e7b48184bca44d. the fix may help with initial block chain download, but it breaks normal day-to-day syncing of the blockchain. revert for now, look into it again later. --- src/main.cpp | 5 +---- src/main.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 41a29d6b..a3109c0f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4477,10 +4477,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (inv.type == MSG_BLOCK) { UpdateBlockAvailability(pfrom->GetId(), inv.hash); - if (!fAlreadyHave && !fImporting && !fReindex && IsInitialBlockDownload() && !mapBlocksInFlight.count(inv.hash)) { - // !IsInitialBlockDownload() is needed otherwise it start to download the same headers - // several time per peer and from all peers, wasting a lot of computing time and bandwidth - + if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count(inv.hash)) { // First request the headers preceding the announced block. In the normal fully-synced // case where a new block is announced that succeeds the current tip (no reorganization), // there are no such headers. diff --git a/src/main.h b/src/main.h index 2ee60269..f5603992 100644 --- a/src/main.h +++ b/src/main.h @@ -73,7 +73,7 @@ static const int MAX_SCRIPTCHECK_THREADS = 16; /** -par default (number of script-checking threads, 0 = auto) */ static const int DEFAULT_SCRIPTCHECK_THREADS = 0; /** Number of blocks that can be requested at any given time from a single peer. */ -static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 32; +static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 16; /** Timeout in seconds during which a peer must stall block download progress before being disconnected. */ static const unsigned int BLOCK_STALLING_TIMEOUT = 2; /** Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends