Skip to content

Commit 731502a

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

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
@@ -642,7 +642,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request)
642642
std::vector<CMutableTransaction> txVariants(txs.size());
643643

644644
for (unsigned int idx = 0; idx < txs.size(); idx++) {
645-
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) {
645+
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str())) {
646646
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed for tx %d", idx));
647647
}
648648
}
@@ -764,7 +764,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
764764
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true);
765765

766766
CMutableTransaction mtx;
767-
if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) {
767+
if (!DecodeHexTx(mtx, request.params[0].get_str())) {
768768
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
769769
}
770770

src/wallet/rpcwallet.cpp

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

33113311
CMutableTransaction mtx;
3312-
if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) {
3312+
if (!DecodeHexTx(mtx, request.params[0].get_str())) {
33133313
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
33143314
}
33153315

0 commit comments

Comments
 (0)