Skip to content

Commit 5365306

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#26795: rpc: Correct RPCHelpMan for fundrawtransaction's input_weights field
927b8d4 rpc: Correct RPCHelpMan for fundrawtransaction's input_weights field (jdjkelly@gmail.com) Pull request description: `input_weights` is incorrectly documented as a fixed length JSON array, but it is actually a JSON array of JSON objects - this commit changes `input_weights` to use `RPCArg::Type::OBJ` The behavior of `input_weights` as an object exists as a functional test in [wallet_fundrawtransaction.py](https://github.com/bitcoin/bitcoin/blob/master/test/functional/wallet_fundrawtransaction.py). ACKs for top commit: achow101: ACK 927b8d4 Tree-SHA512: 384f5e16be36dba670d64d96f16f1fde2d0d51357e1094ae13eb71d004af0f4dc8bac965b4d2d724ccf64fb671faad37b73055152a9882af24f65dfceaf1e5fb
2 parents 03254c2 + 927b8d4 commit 5365306

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/wallet/rpc/spend.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -763,13 +763,17 @@ RPCHelpMan fundrawtransaction()
763763
},
764764
{"input_weights", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "Inputs and their corresponding weights",
765765
{
766-
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
767-
{"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output index"},
768-
{"weight", RPCArg::Type::NUM, RPCArg::Optional::NO, "The maximum weight for this input, "
769-
"including the weight of the outpoint and sequence number. "
770-
"Note that serialized signature sizes are not guaranteed to be consistent, "
771-
"so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures."
772-
"Remember to convert serialized sizes to weight units when necessary."},
766+
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
767+
{
768+
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
769+
{"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output index"},
770+
{"weight", RPCArg::Type::NUM, RPCArg::Optional::NO, "The maximum weight for this input, "
771+
"including the weight of the outpoint and sequence number. "
772+
"Note that serialized signature sizes are not guaranteed to be consistent, "
773+
"so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures."
774+
"Remember to convert serialized sizes to weight units when necessary."},
775+
},
776+
},
773777
},
774778
},
775779
},

0 commit comments

Comments
 (0)