Skip to content

Commit a7bdf5c

Browse files
MarcoFalkefanquake
authored andcommitted
rpc: Properly deserialize txs with witness before signing
Github-Pull: #19836 Rebased-From: cccc752
1 parent 0b64310 commit a7bdf5c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request)
619619
std::vector<CMutableTransaction> txVariants(txs.size());
620620

621621
for (unsigned int idx = 0; idx < txs.size(); idx++) {
622-
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) {
622+
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str())) {
623623
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed for tx %d", idx));
624624
}
625625
}
@@ -738,7 +738,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
738738
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true);
739739

740740
CMutableTransaction mtx;
741-
if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) {
741+
if (!DecodeHexTx(mtx, request.params[0].get_str())) {
742742
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
743743
}
744744

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3269,7 +3269,7 @@ UniValue signrawtransactionwithwallet(const JSONRPCRequest& request)
32693269
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VSTR}, true);
32703270

32713271
CMutableTransaction mtx;
3272-
if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) {
3272+
if (!DecodeHexTx(mtx, request.params[0].get_str())) {
32733273
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
32743274
}
32753275

0 commit comments

Comments
 (0)