aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2015-11-11 10:10:48 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2015-11-13 21:04:12 +0100
commitd61fcff07112411a1e7c28984777480e0c0873aa (patch)
treeaeeba1fe49bc8b2cddf6fc6925e4f56adb02b47e /src
parentdbd2c135ddb96bdc3a4e870c2371cb1fac227135 (diff)
downloadbitcoin-d61fcff07112411a1e7c28984777480e0c0873aa.tar.xz
don't enforce maxuploadtargets disconnect for whitelisted peers
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());