Skip to content

Commit 6b1066f

Browse files
committed
Ignore whitelisting during IBD for unrequested blocks.
1 parent bfc30b3 commit 6b1066f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4478,8 +4478,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
44784478
pfrom->AddInventoryKnown(inv);
44794479

44804480
CValidationState state;
4481-
// Process all blocks from whitelisted peers, even if not requested.
4482-
ProcessNewBlock(state, pfrom, &block, pfrom->fWhitelisted, NULL);
4481+
// Process all blocks from whitelisted peers, even if not requested,
4482+
// unless we're still syncing with the network.
4483+
// Such an unrequested block may still be processed, subject to the
4484+
// conditions in AcceptBlock().
4485+
bool forceProcessing = pfrom->fWhitelisted && !IsInitialBlockDownload();
4486+
ProcessNewBlock(state, pfrom, &block, forceProcessing, NULL);
44834487
int nDoS;
44844488
if (state.IsInvalid(nDoS)) {
44854489
pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),

0 commit comments

Comments
 (0)