Browse Source

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.
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
40b77d450d
  1. 6
      src/main.cpp

6
src/main.cpp

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

Loading…
Cancel
Save