diff options
author | willcl-ark <will@256k1.dev> | 2024-06-28 12:41:57 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-07-17 11:27:03 +0100 |
commit | f22b9ca70c867a02d6f578dc56d4997b7a4ff9c9 (patch) | |
tree | e41fd8dd3cf88f7ac21a859e393dcbb8f5444c41 | |
parent | 05192ba84c2d0ef727c9dbc1e6af4ce8a59458fa (diff) |
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.
Github-Pull: #30357
Rebased-From: 39cea21ec51b9838669c38fefa14f25c36ae7096
-rw-r--r-- | src/wallet/wallet.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3ac09430d8..af85f561b6 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2184,8 +2184,8 @@ TransactionError CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bool& comp // Complete if every input is now signed complete = true; - for (const auto& input : psbtx.inputs) { - complete &= PSBTInputSigned(input); + for (size_t i = 0; i < psbtx.inputs.size(); ++i) { + complete &= PSBTInputSignedAndVerified(psbtx, i, &txdata); } return TransactionError::OK; |