Skip to content

Commit

Permalink
Fix bug in converttopsbt
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed May 3, 2019
1 parent bb80fd1 commit c8525c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1765,13 +1765,13 @@ UniValue converttopsbt(const JSONRPCRequest& request)

// Remove all scriptSigs and scriptWitnesses from inputs
for (CTxIn& input : tx.vin) {
if ((!input.scriptSig.empty()) && (request.params[1].isNull() || (!request.params[1].isNull() && request.params[1].get_bool()))) {
if (!input.scriptSig.empty() && !permitsigdata) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Inputs must not have scriptSigs");
}
input.scriptSig.clear();
}
for (CTxInWitness& witness: tx.witness.vtxinwit) {
if ((!witness.scriptWitness.IsNull()) && (request.params[1].isNull() || (!request.params[1].isNull() && request.params[1].get_bool()))) {
if (!witness.scriptWitness.IsNull() && !permitsigdata) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Inputs must not have scriptWitnesses");
}
}
Expand Down

0 comments on commit c8525c9

Please sign in to comment.