Skip to content

Commit 795f740

Browse files
committed
fix: skip type check for address-index RPCs that accept polymorphic input
The address-index RPCs (getaddressbalance, getaddresstxids, getaddressdeltas, getaddressutxos, getaddressmempool) declare their first parameter as ARR but actually accept either a bare string (single address) or an object with an addresses array. The stricter type checking from bitcoin#29277 now validates parameter types before the handler runs, causing these RPCs to reject string inputs with 'JSON value of type string is not of expected type array'. Add skip_type_check to these RPCs since they intentionally handle polymorphic input in getAddressesFromParams().
1 parent 18f2e43 commit 795f740

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/rpc/node.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static RPCHelpMan getaddressmempool()
387387
{
388388
{"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
389389
},
390-
},
390+
RPCArgOptions{.skip_type_check = true}},
391391
},
392392
RPCResult{
393393
RPCResult::Type::ARR, "", "",
@@ -460,7 +460,7 @@ static RPCHelpMan getaddressutxos()
460460
{
461461
{"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
462462
},
463-
},
463+
RPCArgOptions{.skip_type_check = true}},
464464
},
465465
RPCResult{
466466
RPCResult::Type::ARR, "", "",
@@ -531,7 +531,7 @@ static RPCHelpMan getaddressdeltas()
531531
{
532532
{"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
533533
},
534-
},
534+
RPCArgOptions{.skip_type_check = true}},
535535
},
536536
RPCResult{
537537
RPCResult::Type::ARR, "", "",
@@ -618,7 +618,7 @@ static RPCHelpMan getaddressbalance()
618618
{
619619
{"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
620620
},
621-
},
621+
RPCArgOptions{.skip_type_check = true}},
622622
},
623623
RPCResult{
624624
RPCResult::Type::OBJ, "", "",
@@ -695,7 +695,7 @@ static RPCHelpMan getaddresstxids()
695695
{
696696
{"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
697697
},
698-
},
698+
RPCArgOptions{.skip_type_check = true}},
699699
},
700700
RPCResult{
701701
RPCResult::Type::ARR, "", "",

0 commit comments

Comments
 (0)