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.
This commit is contained in:
Wladimir J. van der Laan 2015-11-09 14:27:08 +01:00
parent 4ee149a6db
commit 40b77d450d

View file

@ -4303,10 +4303,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
vRecv >> locator >> hashStop;
LOCK(cs_main);
if (IsInitialBlockDownload())
if (IsInitialBlockDownload() && !pfrom->fWhitelisted) {
LogPrint("net", "Ignoring getheaders from peer=%d because node is in initial block download\n", pfrom->id);
return true;
}
CBlockIndex* pindex = NULL;
if (locator.IsNull())
{