Skip to content

Commit 40b77d4

Browse files
committed
Always allow getheaders from whitelisted peers
Process `getheaders` messages from whitelisted peers even if we are in initial block download. Whitelisted peers can always use a node as a block source. Also log a debug message when the request is ignored, for troubleshooting. Fixes #6971.
1 parent 4ee149a commit 40b77d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4303,10 +4303,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
43034303
vRecv >> locator >> hashStop;
43044304

43054305
LOCK(cs_main);
4306-
4307-
if (IsInitialBlockDownload())
4306+
if (IsInitialBlockDownload() && !pfrom->fWhitelisted) {
4307+
LogPrint("net", "Ignoring getheaders from peer=%d because node is in initial block download\n", pfrom->id);
43084308
return true;
4309-
4309+
}
43104310
CBlockIndex* pindex = NULL;
43114311
if (locator.IsNull())
43124312
{

0 commit comments

Comments
 (0)