mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
fix converttopsbt permitsigdata arg, add basic test
This commit is contained in:
@@ -1669,7 +1669,7 @@ UniValue converttopsbt(const JSONRPCRequest& request)
|
||||
|
||||
// Remove all scriptSigs and scriptWitnesses from inputs
|
||||
for (CTxIn& input : tx.vin) {
|
||||
if ((!input.scriptSig.empty() || !input.scriptWitness.IsNull()) && (request.params[1].isNull() || (!request.params[1].isNull() && request.params[1].get_bool()))) {
|
||||
if ((!input.scriptSig.empty() || !input.scriptWitness.IsNull()) && !permitsigdata) {
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Inputs must not have scriptSigs and scriptWitnesses");
|
||||
}
|
||||
input.scriptSig.clear();
|
||||
|
||||
Reference in New Issue
Block a user