@@ -435,8 +435,13 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
435435 " \n Return a JSON object representing the serialized, hex-encoded transaction.\n " ,
436436 {
437437 {" hexstring" , RPCArg::Type::STR_HEX, RPCArg::Optional::NO, " The transaction hex string" },
438- {" iswitness" , RPCArg::Type::BOOL, /* default */ " depends on heuristic tests" , " Whether the transaction hex is a serialized witness transaction\n "
439- " If iswitness is not present, heuristic tests will be used in decoding" },
438+ {" iswitness" , RPCArg::Type::BOOL, /* default */ " depends on heuristic tests" , " Whether the transaction hex is a serialized witness transaction.\n "
439+ " If iswitness is not present, heuristic tests will be used in decoding.\n "
440+ " If true, only witness deserialization will be tried.\n "
441+ " If false, only non-witness deserialization will be tried.\n "
442+ " This boolean should reflect whether the transaction has inputs\n "
443+ " (e.g. fully valid, or on-chain transactions), if known by the caller."
444+ },
440445 },
441446 RPCResult{
442447 " {\n "
@@ -1422,12 +1427,15 @@ UniValue converttopsbt(const JSONRPCRequest& request)
14221427 " createpsbt and walletcreatefundedpsbt should be used for new applications.\n " ,
14231428 {
14241429 {" hexstring" , RPCArg::Type::STR_HEX, RPCArg::Optional::NO, " The hex string of a raw transaction" },
1425- {" permitsigdata" , RPCArg::Type::BOOL, /* default */ " false" , " If true, any signatures in the input will be discarded and conversion. \n "
1430+ {" permitsigdata" , RPCArg::Type::BOOL, /* default */ " false" , " If true, any signatures in the input will be discarded and conversion\n "
14261431 " will continue. If false, RPC will fail if any signatures are present." },
14271432 {" iswitness" , RPCArg::Type::BOOL, /* default */ " depends on heuristic tests" , " Whether the transaction hex is a serialized witness transaction.\n "
1428- " If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserializaion\n "
1429- " will be tried. If false, only non-witness deserialization will be tried. Only has an effect if\n "
1430- " permitsigdata is true." },
1433+ " If iswitness is not present, heuristic tests will be used in decoding.\n "
1434+ " If true, only witness deserialization will be tried.\n "
1435+ " If false, only non-witness deserialization will be tried.\n "
1436+ " This boolean should reflect whether the transaction has inputs\n "
1437+ " (e.g. fully valid, or on-chain transactions), if known by the caller."
1438+ },
14311439 },
14321440 RPCResult{
14331441 " \" psbt\" (string) The resulting raw transaction (base64-encoded string)\n "
@@ -1444,16 +1452,15 @@ UniValue converttopsbt(const JSONRPCRequest& request)
14441452 throw std::runtime_error (help.ToString ());
14451453 }
14461454
1447-
14481455 RPCTypeCheck (request.params , {UniValue::VSTR, UniValue::VBOOL, UniValue::VBOOL}, true );
14491456
14501457 // parse hex string from parameter
14511458 CMutableTransaction tx;
14521459 bool permitsigdata = request.params [1 ].isNull () ? false : request.params [1 ].get_bool ();
14531460 bool witness_specified = !request.params [2 ].isNull ();
14541461 bool iswitness = witness_specified ? request.params [2 ].get_bool () : false ;
1455- bool try_witness = permitsigdata ? ( witness_specified ? iswitness : true ) : false ;
1456- bool try_no_witness = permitsigdata ? ( witness_specified ? !iswitness : true ) : true ;
1462+ const bool try_witness = witness_specified ? iswitness : true ;
1463+ const bool try_no_witness = witness_specified ? !iswitness : true ;
14571464 if (!DecodeHexTx (tx, request.params [0 ].get_str (), try_no_witness, try_witness)) {
14581465 throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed" );
14591466 }
0 commit comments