Skip to content

Commit ef1c43e

Browse files
committed
RPC/blockchain: Add getblockfrompeer nodeid alias for backward compatibility
Knots 21.x and 22.0 used nodeid rather than peer_id param name
1 parent bbbf89a commit ef1c43e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static RPCHelpMan getblockfrompeer()
437437
"Returns an empty JSON object if the request was successfully scheduled.",
438438
{
439439
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash to try to fetch"},
440-
{"peer_id", RPCArg::Type::NUM, RPCArg::Optional::NO, "The peer to fetch it from (see getpeerinfo for peer IDs)"},
440+
{"peer_id|nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The peer to fetch it from (see getpeerinfo for peer IDs)"},
441441
},
442442
RPCResult{RPCResult::Type::OBJ, "", /*optional=*/false, "", {}},
443443
RPCExamples{

src/rpc/client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
6565
{ "getbalance", 2, "include_watchonly" },
6666
{ "getbalance", 3, "avoid_reuse" },
6767
{ "getblockfrompeer", 1, "peer_id" },
68+
{ "getblockfrompeer", 1, "nodeid" },
6869
{ "getblockhash", 0, "height" },
6970
{ "waitforblockheight", 0, "height" },
7071
{ "waitforblockheight", 1, "timeout" },

0 commit comments

Comments
 (0)