Skip to content

Commit cccc752

Browse files
author
MarcoFalke
committed
rpc: Properly deserialize txs with witness before signing
1 parent baf9ced commit cccc752

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

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

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

src/wallet/rpcwallet.cpp

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

32313231
CMutableTransaction mtx;
3232-
if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) {
3232+
if (!DecodeHexTx(mtx, request.params[0].get_str())) {
32333233
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
32343234
}
32353235

0 commit comments

Comments
 (0)