aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-11-09 14:27:08 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-11-09 14:28:49 +0100
commit40b77d450dff6879c50a33d4e7f795c385fb0002 (patch)
treeae7a9e869f271f26edd1b9c2e54d4055e93cf684 /src/main.cpp
parent4ee149a6db25cde31432f83369b40c92be13021c (diff)
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9016fe42a0..c5c5e40ee8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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())
{