This PR fixes the help text for the signrawtransactionwithwallet and signrawtransactionwithkey RPC calls. They both marked the amount field in the UTXO dependencies as required. This field is omitted in the rpc_rawtransaction.py test and successful_signing_test in rpc_signrawtransaction.py.
rpc: Fix help text for signtransactionwithXXX #15669
pull torkelrogstad wants to merge 1 commits into bitcoin:master from torkelrogstad:signrawtx-rpc-help changing 2 files +2 −2-
torkelrogstad commented at 4:48 PM on March 26, 2019: contributor
-
in src/rpc/rawtransaction.cpp:967 in 62e7f39a36 outdated
963 | @@ -964,7 +964,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request) 964 | {"scriptPubKey", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "script key"}, 965 | {"redeemScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "(required for P2SH) redeem script"}, 966 | {"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "(required for P2WSH or P2SH-P2WSH) witness script"}, 967 | - {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The amount spent"}, 968 | + {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::OMITTED_NAMED_ARG, "The amount spent"},
MarcoFalke commented at 5:44 PM on March 26, 2019:It should be explained when it is not required instead of just stating that it is not required.
torkelrogstad commented at 5:35 PM on March 27, 2019:Would it be sufficient to say it's only required for segwit inputs?
sipa commented at 5:50 PM on March 27, 2019:Indeed (it's required for segwit inputs, and useless for non-segwit inputs).
torkelrogstad commented at 9:14 PM on March 27, 2019:Pushed fix
fanquake added the label RPC/REST/ZMQ on Mar 26, 2019torkelrogstad force-pushed on Mar 27, 2019in src/wallet/rpcwallet.cpp:3153 in 9e7a1345c7 outdated
3149 | @@ -3150,7 +3150,7 @@ UniValue signrawtransactionwithwallet(const JSONRPCRequest& request) 3150 | {"scriptPubKey", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "script key"}, 3151 | {"redeemScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "(required for P2SH) redeem script"}, 3152 | {"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "(required for P2WSH or P2SH-P2WSH) witness script"}, 3153 | - {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The amount spent"}, 3154 | + {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::OMITTED, "(required for non-P2PKH) the amount spent"},
MarcoFalke commented at 9:32 PM on March 27, 2019:This isn't wrong, but it would be nice to use the same help string as above
torkelrogstad commented at 7:55 AM on March 28, 2019:Pushed changes
MarcoFalke commented at 9:32 PM on March 27, 2019: memberACK
rpc: Fix help text for signtransactionwithXXX afc06fc868torkelrogstad force-pushed on Mar 28, 2019MarcoFalke approvedMarcoFalke commented at 1:29 PM on March 28, 2019: memberutACK afc06fc8687e394e93d568e59808bb2660a75e06
MarcoFalke added this to the milestone 0.19.0 on Mar 28, 2019promag commented at 9:38 PM on March 29, 2019: memberutACK afc06fc.
MarcoFalke added the label Docs on Mar 29, 2019MarcoFalke referenced this in commit 79c345a011 on Mar 29, 2019MarcoFalke merged this on Mar 29, 2019MarcoFalke closed this on Mar 29, 2019torkelrogstad deleted the branch on Apr 1, 2019DrahtBot locked this on Dec 16, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me