Skip to content

Commit 91990ee

Browse files
committed
Merge #8272: Make the dummy argument to getaddednodeinfo optional
854f1af Make the dummy argument to getaddednodeinfo optional (Pieter Wuille)
2 parents f061415 + 854f1af commit 91990ee

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

doc/release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ UTXO set query (`GET /rest/getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<tx
6363
were changed to return status code HTTP_BAD_REQUEST (400) instead of HTTP_INTERNAL_SERVER_ERROR (500) when requests
6464
contain invalid parameters.
6565

66+
The first boolean argument to `getaddednodeinfo` has been removed. This is an incompatible change.
67+
6668
### Configuration and command-line options
6769

6870
### Block and transaction handling

src/rpc/client.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
2626
{
2727
{ "stop", 0 },
2828
{ "setmocktime", 0 },
29-
{ "getaddednodeinfo", 0 },
3029
{ "generate", 0 },
3130
{ "generate", 1 },
3231
{ "generatetoaddress", 0 },

src/rpc/net.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,13 @@ UniValue disconnectnode(const UniValue& params, bool fHelp)
269269

270270
UniValue getaddednodeinfo(const UniValue& params, bool fHelp)
271271
{
272-
if (fHelp || params.size() < 1 || params.size() > 2)
272+
if (fHelp || params.size() > 1)
273273
throw runtime_error(
274-
"getaddednodeinfo dummy ( \"node\" )\n"
274+
"getaddednodeinfo ( \"node\" )\n"
275275
"\nReturns information about the given added node, or all added nodes\n"
276276
"(note that onetry addnodes are not listed here)\n"
277277
"\nArguments:\n"
278-
"1. dummy (boolean, required) Kept for historical purposes but ignored\n"
279-
"2. \"node\" (string, optional) If provided, return information about this specific node, otherwise all nodes are returned.\n"
278+
"1. \"node\" (string, optional) If provided, return information about this specific node, otherwise all nodes are returned.\n"
280279
"\nResult:\n"
281280
"[\n"
282281
" {\n"
@@ -299,10 +298,10 @@ UniValue getaddednodeinfo(const UniValue& params, bool fHelp)
299298

300299
std::vector<AddedNodeInfo> vInfo = GetAddedNodeInfo();
301300

302-
if (params.size() == 2) {
301+
if (params.size() == 1) {
303302
bool found = false;
304303
for (const AddedNodeInfo& info : vInfo) {
305-
if (info.strAddedNode == params[1].get_str()) {
304+
if (info.strAddedNode == params[0].get_str()) {
306305
vInfo.assign(1, info);
307306
found = true;
308307
break;

0 commit comments

Comments
 (0)