diff --git a/src/script/sign.h b/src/script/sign.h --- a/src/script/sign.h +++ b/src/script/sign.h @@ -665,7 +665,10 @@ CMutableTransaction &txTo, unsigned int nIn, SigHashType sigHashType); -/** Signs a PSBTInput */ +/** + * Signs a PSBTInput, verifying that all provided data matches what is being + * signed. + */ bool SignPSBTInput(const SigningProvider &provider, const CMutableTransaction &tx, PSBTInput &input, SignatureData &sigdata, int index, diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5141,10 +5141,11 @@ // If we don't know about this input, skip it and let someone else deal // with it const TxId &txid = txin.prevout.GetTxId(); - const auto &it = pwallet->mapWallet.find(txid); + const auto it = pwallet->mapWallet.find(txid); if (it != pwallet->mapWallet.end()) { const CWalletTx &wtx = it->second; CTxOut utxo = wtx.tx->vout[txin.prevout.GetN()]; + // Update UTXOs from the wallet. input.utxo = utxo; }