Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864592
D9277.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D9277.id.diff
View Options
diff --git a/doc/reduce-traffic.md b/doc/reduce-traffic.md
--- a/doc/reduce-traffic.md
+++ b/doc/reduce-traffic.md
@@ -23,7 +23,7 @@
Keep in mind that new nodes require other nodes that are willing to serve
historic blocks.
-Whitelisted peers will never be disconnected, although their traffic counts for
+Peers with the `noban` permission will never be disconnected, although their traffic counts for
calculating the target.
## 2. Disable "listening" (`-listen=0`)
diff --git a/src/init.cpp b/src/init.cpp
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -802,7 +802,8 @@
argsman.AddArg(
"-maxuploadtarget=<n>",
strprintf("Tries to keep outbound traffic under the given target (in "
- "MiB per 24h), 0 = no limit (default: %d)",
+ "MiB per 24h). Limit does not apply to peers with 'noban' "
+ "permission. 0 = no limit (default: %d)",
DEFAULT_MAX_UPLOAD_TARGET),
ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
diff --git a/src/net.cpp b/src/net.cpp
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2884,7 +2884,7 @@
nMaxOutboundTotalBytesSentInCycle = 0;
}
- // TODO, exclude whitebind peers
+ // TODO, exclude peers with noban permission
nMaxOutboundTotalBytesSentInCycle += bytes;
}
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1853,12 +1853,12 @@
const CNetMsgMaker msgMaker(pfrom.GetCommonVersion());
// Disconnect node in case we have reached the outbound limit for serving
// historical blocks.
- // Never disconnect whitelisted nodes.
if (send && connman.OutboundTargetReached(true) &&
(((pindexBestHeader != nullptr) &&
(pindexBestHeader->GetBlockTime() - pindex->GetBlockTime() >
HISTORICAL_BLOCK_AGE)) ||
inv.type == MSG_FILTERED_BLOCK) &&
+ /* never disconnect nodes with the noban permission */
!pfrom.HasPermission(PF_NOBAN)) {
LogPrint(BCLog::NET,
"historical block serving limit reached, disconnect peer=%d\n",
diff --git a/test/functional/feature_maxuploadtarget.py b/test/functional/feature_maxuploadtarget.py
--- a/test/functional/feature_maxuploadtarget.py
+++ b/test/functional/feature_maxuploadtarget.py
@@ -152,9 +152,8 @@
self.log.info("Restarting node 0 with noban permission"
" and 1MB maxuploadtarget")
- self.stop_node(0)
- self.start_node(0, ["-whitelist=noban@127.0.0.1",
- "-maxuploadtarget=1", "-blockmaxsize=999000"])
+ self.restart_node(0, ["-whitelist=noban@127.0.0.1",
+ "-maxuploadtarget=1", "-blockmaxsize=999000"])
# Reconnect to self.nodes[0]
self.nodes[0].add_p2p_connection(TestP2PConn())
@@ -168,11 +167,12 @@
getdata_request.inv = [CInv(MSG_BLOCK, big_old_block)]
self.nodes[0].p2p.send_and_ping(getdata_request)
- # node is still connected because of the whitelist
+ # node is still connected because of the noban permission
assert_equal(len(self.nodes[0].getpeerinfo()), 1)
self.log.info(
- "Peer still connected after trying to download old block (whitelisted)")
+ "Peer still connected after trying to download old block "
+ "(noban permission)")
if __name__ == '__main__':
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 20, 20:43 (9 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5862745
Default Alt Text
D9277.id.diff (3 KB)
Attached To
D9277: doc: noban precludes maxuploadtarget disconnects
Event Timeline
Log In to Comment