HomePhabricator

[electrum] cache scriptsig for complete inputs, invalidate it for incomplete…

Description

[electrum] cache scriptsig for complete inputs, invalidate it for incomplete inputs

Summary:
When computing the scriptsig, cache it if the input is fully signed. If the input is incomplete, don't return the cached scriptsig in get_or_build_scriptsig as it could have change if the signatures are updated.

Use the built scriptsig also for equality comparison and hashing. I missed this in D14493, and it is important when comparing inputs that don't yet have a scriptsig or have just been updated (signatures added).

Test Plan: python test_runner.py

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14500

Details

Provenance
PiRKAuthored on Sep 18 2023, 12:14
PiRKPushed on Sep 19 2023, 10:50
Reviewer
Restricted Project
Differential Revision
D14500: [electrum] cache scriptsig for complete inputs, invalidate it for incomplete inputs
Parents
rABCa205331930bc: [electrum] move get_preimage_script from Transaction to TxInput
Branches
Unknown
Tags
Unknown