mirror of
https://github.com/jwinterm/myriadcoin.git
synced 2026-10-19 05:58:38 +02:00
fix bug in initial-block-headers download
saves several gigabytes of bandwidth thanks to Cryptoslave of Anoncoin for this fix.
This commit is contained in:
+4
-1
@@ -4477,7 +4477,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
|
||||
if (inv.type == MSG_BLOCK) {
|
||||
UpdateBlockAvailability(pfrom->GetId(), inv.hash);
|
||||
if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count(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
|
||||
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user