You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin/bitcoin#26366: rpc, test: addnode improv + add test coverage for invalid command
f52cb02 doc: make it clear that `node` in `addnode` refers to the node's address (brunoerg)
effd1ef test: `addnode` with an invalid command should throw an error (brunoerg)
56b27b8 rpc, refactor: clean-up `addnode` (brunoerg)
Pull request description:
This PR:
- Adds test coverage for an invalid `command` in `addnode`.
- Rename `test_getaddednodeinfo` to `test_addnode_getaddednodeinfo` and its log since this function also tests `addnode` and it doesn't worth to split into 2 ones.
- Makes it clear in docs that `node` in `addnode` refers to the node's address. It seemed a little weird for me "The node (see getpeerinfo for nodes)", it could mean a lot of things e.g. the node id.
- Some small improv/clean-up: use `const` where possible, rename some vars, and remove the check for nullance for `command` since it's a non-optional field.
ACKs for top commit:
achow101:
ACK f52cb02
jonatack:
ACK f52cb02
theStack:
re-ACK f52cb02
Tree-SHA512: e4a69e58b784e233463945b4d55a401957f9fe4562c129f59216a44f44fb3221d3449ac578fb35e665ca654c6ade2e741b72c3df78040f7527229c77b6c5b82e
Copy file name to clipboardExpand all lines: src/rpc/net.cpp
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -287,7 +287,7 @@ static RPCHelpMan addnode()
287
287
strprintf("Addnode connections are limited to %u at a time", MAX_ADDNODE_CONNECTIONS) +
288
288
" and are counted separately from the -maxconnections limit.\n",
289
289
{
290
-
{"node", RPCArg::Type::STR, RPCArg::Optional::NO, "The node (see getpeerinfo for nodes)"},
290
+
{"node", RPCArg::Type::STR, RPCArg::Optional::NO, "The address of the peer to connect to"},
291
291
{"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"},
0 commit comments