From 87e7f37918d42c28033e9f684db52f94eeed617b Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Wed, 24 Sep 2025 08:34:44 +0200 Subject: [PATCH] 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. --- src/rpc/net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 3a0432d7a9e..da01a60b9ec 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -130,7 +130,7 @@ static RPCHelpMan getpeerinfo() { { {RPCResult::Type::NUM, "id", "Peer index"}, - {RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"}, + {RPCResult::Type::STR, "addr", "(host:port) The IP address/hostname optionally followed by :port of the peer"}, {RPCResult::Type::STR, "addrbind", /*optional=*/true, "(ip:port) Bind address of the connection to the peer"}, {RPCResult::Type::STR, "addrlocal", /*optional=*/true, "(ip:port) Local address as reported by the peer"}, {RPCResult::Type::STR, "network", "Network (" + Join(GetNetworkNames(/*append_unroutable=*/true), ", ") + ")"}, @@ -322,7 +322,7 @@ static RPCHelpMan addnode() strprintf("Addnode connections are limited to %u at a time", MAX_ADDNODE_CONNECTIONS) + " and are counted separately from the -maxconnections limit.\n", { - {"node", RPCArg::Type::STR, RPCArg::Optional::NO, "The address of the peer to connect to"}, + {"node", RPCArg::Type::STR, RPCArg::Optional::NO, "The IP address/hostname optionally followed by :port of the peer to connect to"}, {"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"}, {"v2transport", RPCArg::Type::BOOL, RPCArg::DefaultHint{"set by -v2transport"}, "Attempt to connect using BIP324 v2 transport protocol (ignored for 'remove' command)"}, },