diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1721,9 +1721,8 @@ for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { PSBTInput &input = psbtx.inputs.at(i); - SignatureData sigdata; - complete &= SignPSBTInput(DUMMY_SIGNING_PROVIDER, *psbtx.tx, input, - sigdata, i, SigHashType()); + complete &= SignPSBTInput(DUMMY_SIGNING_PROVIDER, *psbtx.tx, input, i, + SigHashType()); } UniValue result(UniValue::VOBJ); diff --git a/src/script/sign.h b/src/script/sign.h --- a/src/script/sign.h +++ b/src/script/sign.h @@ -118,7 +118,7 @@ // create a signature and is also filled by ProduceSignature in order to // construct final scriptSigs. struct SignatureData { - /// Stores whether the scriptSig and scriptWitness are complete. + /// Stores whether the scriptSig are complete. bool complete = false; /// The scriptSig of an input. Contains complete signatures or the /// traditional partial signatures format. @@ -692,8 +692,7 @@ * signed. */ bool SignPSBTInput(const SigningProvider &provider, - const CMutableTransaction &tx, PSBTInput &input, - SignatureData &sigdata, int index, + const CMutableTransaction &tx, PSBTInput &input, int index, SigHashType sighash = SigHashType()); /** Extract signature data from a transaction input, and insert it. */ diff --git a/src/script/sign.cpp b/src/script/sign.cpp --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -223,14 +223,15 @@ } bool SignPSBTInput(const SigningProvider &provider, - const CMutableTransaction &tx, PSBTInput &input, - SignatureData &sigdata, int index, SigHashType sighash) { + const CMutableTransaction &tx, PSBTInput &input, int index, + SigHashType sighash) { // If this input has a final scriptsig, don't do anything with it. if (!input.final_script_sig.empty()) { return true; } // Fill SignatureData with input info + SignatureData sigdata; input.FillSignatureData(sigdata); // Get UTXO @@ -245,6 +246,7 @@ bool sig_complete = ProduceSignature(provider, creator, utxo.scriptPubKey, sigdata); input.FromSignatureData(sigdata); + return sig_complete; } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5126,10 +5126,9 @@ "Specified sighash and sighash in PSBT do not match."); } - SignatureData sigdata; complete &= SignPSBTInput(HidingSigningProvider(pwallet, !sign, !bip32derivs), - *psbtx.tx, input, sigdata, i, sighash_type); + *psbtx.tx, input, i, sighash_type); } // Fill in the bip32 keypaths and redeemscripts for the outputs so that