diff options
author | Suhas Daftuar <sdaftuar@gmail.com> | 2015-06-02 20:46:41 -0400 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2015-06-30 09:42:56 -0400 |
commit | 6b1066fab41523d25d75b45a10e4b0f61d7c61d0 (patch) | |
tree | c07180c99ebbb93db8e2218f95311262aee35e5b /src/main.cpp | |
parent | bfc30b34374d71928acee5ff41282f09cedfd5e4 (diff) |
Ignore whitelisting during IBD for unrequested blocks.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index e0997515b7..87750f9ea3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4478,8 +4478,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pfrom->AddInventoryKnown(inv); CValidationState state; - // Process all blocks from whitelisted peers, even if not requested. - ProcessNewBlock(state, pfrom, &block, pfrom->fWhitelisted, NULL); + // Process all blocks from whitelisted peers, even if not requested, + // unless we're still syncing with the network. + // Such an unrequested block may still be processed, subject to the + // conditions in AcceptBlock(). + bool forceProcessing = pfrom->fWhitelisted && !IsInitialBlockDownload(); + ProcessNewBlock(state, pfrom, &block, forceProcessing, NULL); int nDoS; if (state.IsInvalid(nDoS)) { pfrom->PushMessage("reject", strCommand, state.GetRejectCode(), |