aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2015-11-13 23:54:16 -0800
committerGregory Maxwell <greg@xiph.org>2015-11-13 23:54:36 -0800
commit9ffc687288dda3688d8d8e8ab95e612d47bac418 (patch)
treeb47139ee8a744ac5a8fdf7522e310086b031455c /src
parent44ac42e50d567b08d3cb3f3c5766588468ce5bbf (diff)
parente495ed5f08fa9b62174c7f8f4636e0e5f63a1f4d (diff)
downloadbitcoin-9ffc687288dda3688d8d8e8ab95e612d47bac418.tar.xz
Merge pull request #6984
e495ed5 add documentation for exluding whitelistes peer from maxuploadtarget (Jonas Schnelli) 5760749 [docs] rename reducetraffic.md to reduce-traffic.md (Jonas Schnelli) d61fcff don't enforce maxuploadtargets disconnect for whitelisted peers (Jonas Schnelli)
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5208fbb031..4647112d4c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3867,8 +3867,9 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
}
}
// disconnect node in case we have reached the outbound limit for serving historical blocks
+ // never disconnect whitelisted nodes
static const int nOneWeek = 7 * 24 * 60 * 60; // assume > 1 week = historical
- if (send && CNode::OutboundTargetReached(true) && ( ((pindexBestHeader != NULL) && (pindexBestHeader->GetBlockTime() - mi->second->GetBlockTime() > nOneWeek)) || inv.type == MSG_FILTERED_BLOCK) )
+ if (send && CNode::OutboundTargetReached(true) && ( ((pindexBestHeader != NULL) && (pindexBestHeader->GetBlockTime() - mi->second->GetBlockTime() > nOneWeek)) || inv.type == MSG_FILTERED_BLOCK) && !pfrom->fWhitelisted)
{
LogPrint("net", "historical block serving limit reached, disconnect peer=%d\n", pfrom->GetId());