diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-09 17:02:20 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-07-09 17:03:27 +0200 |
commit | cc9d09e73de0fa5639bd782166b171448fd6b90b (patch) | |
tree | a319e9e3eb1d1cb2db6d3a3305e1173033de372e /src/net_processing.cpp | |
parent | 0d69fdb9a0e3edab45f2749cf026afe509a550e9 (diff) | |
parent | fa0540cd46eaf44d9e1a9f91c3a937986826c4fa (diff) | |
download | bitcoin-cc9d09e73de0fa5639bd782166b171448fd6b90b.tar.xz |
Merge #19191: net: Extract download permission from noban
fa0540cd46eaf44d9e1a9f91c3a937986826c4fa net: Extract download permission from noban (MarcoFalke)
Pull request description:
It should be possible to grant nodes in a local network (e.g. home, university, enterprise, ...) permission to download blocks even after the maxuploadtarget is hit.
Currently this is only possible by setting the `noban` permission, which has some adverse effects, especially if the peers can't be fully trusted.
Fix this by extracting a `download` permission from `noban`.
ACKs for top commit:
jonatack:
ACK fa0540c
Sjors:
re-utACK fa0540cd46eaf44d9e1a9f91c3a937986826c4fa
Tree-SHA512: 255566baa43ae925d93f5d0a3aa66b475a556d1590f662a88278a4872f16a1a05739a6119ae48a293011868042e05cb264cffe5822a50fb80db7333bf44376d9
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index f1a89a8936..7f89443243 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1509,7 +1509,7 @@ void static ProcessGetBlockData(CNode& pfrom, const CChainParams& chainparams, c if (send && connman->OutboundTargetReached(true) && (((pindexBestHeader != nullptr) && (pindexBestHeader->GetBlockTime() - pindex->GetBlockTime() > HISTORICAL_BLOCK_AGE)) || inv.type == MSG_FILTERED_BLOCK) && - !pfrom.HasPermission(PF_NOBAN) // never disconnect nodes with the noban permission + !pfrom.HasPermission(PF_DOWNLOAD) // nodes with the download permission may exceed target ) { LogPrint(BCLog::NET, "historical block serving limit reached, disconnect peer=%d\n", pfrom.GetId()); @@ -2739,7 +2739,7 @@ void ProcessMessage( } LOCK(cs_main); - if (::ChainstateActive().IsInitialBlockDownload() && !pfrom.HasPermission(PF_NOBAN)) { + if (::ChainstateActive().IsInitialBlockDownload() && !pfrom.HasPermission(PF_DOWNLOAD)) { LogPrint(BCLog::NET, "Ignoring getheaders from peer=%d because node is in initial block download\n", pfrom.GetId()); return; } |