mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Merge pull request #6622
17a073aAdd RPC test for -maxuploadtarget (Suhas Daftuar)872fee3Introduce -maxuploadtarget (Jonas Schnelli)
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -3835,6 +3835,16 @@ void static ProcessGetData(CNode* pfrom)
|
||||
}
|
||||
}
|
||||
}
|
||||
// disconnect node in case we have reached the outbound limit for serving historical blocks
|
||||
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) )
|
||||
{
|
||||
LogPrint("net", "historical block serving limit reached, disconnect peer=%d\n", pfrom->GetId());
|
||||
|
||||
//disconnect node
|
||||
pfrom->fDisconnect = true;
|
||||
send = false;
|
||||
}
|
||||
// Pruned nodes may have deleted the block, so check whether
|
||||
// it's available before trying to send.
|
||||
if (send && (mi->second->nStatus & BLOCK_HAVE_DATA))
|
||||
|
||||
Reference in New Issue
Block a user