Skip to content

Commit 39cea21

Browse files
committed
wallet: fix FillPSBT errantly showing as complete
Fix cases of calls to `FillPSBT` returning `complete=true` when it's not the case. This can happen when some inputs have been signed but the transaction is subsequently modified, e.g. in the context of PayJoins. Also fixes a related bug where a finalized hex string is attempted to be added during `walletprocesspsbt` but a CHECK_NONFATAL causes an abort. Reported in #30077.
1 parent 04d63fb commit 39cea21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,8 +2225,8 @@ std::optional<PSBTError> CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bo
22252225

22262226
// Complete if every input is now signed
22272227
complete = true;
2228-
for (const auto& input : psbtx.inputs) {
2229-
complete &= PSBTInputSigned(input);
2228+
for (size_t i = 0; i < psbtx.inputs.size(); ++i) {
2229+
complete &= PSBTInputSignedAndVerified(psbtx, i, &txdata);
22302230
}
22312231

22322232
return {};

0 commit comments

Comments
 (0)