Skip to content

Commit 032ba3f

Browse files
committed
RPC help documentation for addnode peerinfo.
Also adds a comment about the netgroup exclusion behavior.
1 parent 90f13e1 commit 032ba3f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/net.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,11 @@ void CConnman::ThreadOpenConnections()
16331633
LOCK(cs_vNodes);
16341634
BOOST_FOREACH(CNode* pnode, vNodes) {
16351635
if (!pnode->fInbound && !pnode->fAddnode) {
1636+
// Netgroups for inbound and addnode peers are not excluded because our goal here
1637+
// is to not use multiple of our limited outbound slots on a single netgroup
1638+
// but inbound and addnode peers do not use our outbound slots. Inbound peers
1639+
// also have the added issue that they're attacker controlled and could be used
1640+
// to prevent us from connecting to particular hosts if we used them here.
16361641
setConnected.insert(pnode->addr.GetGroup());
16371642
nOutbound++;
16381643
}

src/rpc/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
9292
" \"version\": v, (numeric) The peer version, such as 7001\n"
9393
" \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n"
9494
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
95+
" \"addnode\": true|false, (boolean) Whether connection was due to addnode and is using an addnode slot\n"
9596
" \"startingheight\": n, (numeric) The starting height (block) of the peer\n"
9697
" \"banscore\": n, (numeric) The ban score\n"
9798
" \"synced_headers\": n, (numeric) The last header we have in common with this peer\n"

0 commit comments

Comments
 (0)