Skip to content

Commit 87e7f37

Browse files
committed
doc: clarify peer address in getpeerinfo and addnode RPC help
The returned value in `getpeerinfo/addr` could be a hostname as well as an IP address and the `:port` part could be missing. It is displayed from `CNode::m_addr_name` which could have been set from RPC `addnode` where the argument is allowed to be a hostname and an optional port.
1 parent 2a4450c commit 87e7f37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rpc/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static RPCHelpMan getpeerinfo()
130130
{
131131
{
132132
{RPCResult::Type::NUM, "id", "Peer index"},
133-
{RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"},
133+
{RPCResult::Type::STR, "addr", "(host:port) The IP address/hostname optionally followed by :port of the peer"},
134134
{RPCResult::Type::STR, "addrbind", /*optional=*/true, "(ip:port) Bind address of the connection to the peer"},
135135
{RPCResult::Type::STR, "addrlocal", /*optional=*/true, "(ip:port) Local address as reported by the peer"},
136136
{RPCResult::Type::STR, "network", "Network (" + Join(GetNetworkNames(/*append_unroutable=*/true), ", ") + ")"},
@@ -322,7 +322,7 @@ static RPCHelpMan addnode()
322322
strprintf("Addnode connections are limited to %u at a time", MAX_ADDNODE_CONNECTIONS) +
323323
" and are counted separately from the -maxconnections limit.\n",
324324
{
325-
{"node", RPCArg::Type::STR, RPCArg::Optional::NO, "The address of the peer to connect to"},
325+
{"node", RPCArg::Type::STR, RPCArg::Optional::NO, "The IP address/hostname optionally followed by :port of the peer to connect to"},
326326
{"command", RPCArg::Type::STR, RPCArg::Optional::NO, "'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once"},
327327
{"v2transport", RPCArg::Type::BOOL, RPCArg::DefaultHint{"set by -v2transport"}, "Attempt to connect using BIP324 v2 transport protocol (ignored for 'remove' command)"},
328328
},

0 commit comments

Comments
 (0)