mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-18 11:29:06 +00:00
6a326cf66f04948ffe729e5540a69e159a7840ad tests: Test that a fully signed tx given to signrawtx is unchanged (Andrew Chow) 2d48d7dcfb93eeec36dd6f5cbad289b89ec69324 Simplify and fix CWallet::SignTransaction (Andrew Chow) Pull request description: Backport `CWallet::SignTransaction` from master which is simpler and not broken. Previously `CWallet::SignTransaction` would return false for a fully signed transaction. This is a regression and obviously incorrect - a fully signed transaction is always complete. This occurs because `CWallet::SignTransaction` would iterate through each input and skip any further checks if the input was already signed. It would then end up falling through to the `return false` catch-all thus erroneously saying a fully signed transaction is incomplete. The change to attempting to use all `ScriptPubKeyMan`s fixes this problem since the `LegacyScriptPubKeyMan` (the only spkm implemented in 0.20) will verify inputs during its signing attempt and correctly return that it is complete when the inputs verify. Thus a fully signed transaction will be correctly identified as complete, `LegacyScriptPubKeyMan::SignTranaction` will return true, and so `CWallet::Transaction` will return true too. Note that this is not a backport of any specific commit. Rather it is the end result of the changes we have made to this function in master. Fixes #19737 ACKs for top commit: fjahr: Code review ACK 6a326cf66f04948ffe729e5540a69e159a7840ad MarcoFalke: re-ACK 6a326cf66f 👓 Tree-SHA512: 7b8e04cfc264de01a2de08a99477c1a110fa0965dcbd4305bf4632a165f28b090746789195f5cb584eb6d85e27d4801a09d2dad28e508d7898c7c088e771812b