Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #582 +/- ##
==========================================
- Coverage 81.66% 81.44% -0.23%
==========================================
Files 25 25
Lines 6339 6295 -44
Branches 302 301 -1
==========================================
- Hits 5177 5127 -50
- Misses 1055 1061 +6
Partials 107 107
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Dmenec
force-pushed
the
fix/finalize-psbt-timelocks
branch
from
October 3, 2026 13:25
6d86b26 to
3092e28
Compare
- test_finalize_psbt_requires_locktime_for_cltv A PSBT whose `nLockTime` does not enforce `after` must not be finalized, even if the tip is past the lock height. - test_finalize_psbt_requires_sequence_for_csv A PSBT whose `nSequence` does not enforce `older` must not be finalized, even if the input has enough confirmations.
`After` and `Older` are no longer needed in the finalizer to check a PSBT's timelocks, since miniscript's `PsbtInputSatisfier` already checks `nLockTime` and `nSequence`. The satisfiers were combined as a tuple, which miniscript treats as an OR, so `After` and `Older`, which only look at the chain height, could finalize a PSBT that does not enforce the timelock.
`SignOptions::assume_height` only fed `After` and `Older`, so it no longer has any use and is deprecated.
Dmenec
force-pushed
the
fix/finalize-psbt-timelocks
branch
from
October 5, 2026 20:07
3092e28 to
2c5c01a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #580, fixes #557.
finalize_psbtsatisfied descriptors with the tuple(PsbtInputSatisfier, After, Older). The satisfiers are treated as an OR, andAfterandOlderonly look at the chain height. So a PSBT whosenLockTimeornSequencedoes not enforce the timelock was still finalized through theafter/olderbranch.PsbtInputSatisfieralready checksnLockTimeandnSequence, so this PR dropsAfterandOlderfrom the finalizer.SignOptions::assume_heightonly fed them, so its no longer used.Notes to the reviewers
AfterandOlderdate back to when the finalizer usedpsbt::Inputas its satisfier, which cannot see the transaction and so could not check timelocks on its own. They stayed in the tuple when it was switched toPsbtInputSatisfierin 100f0aa, and since then they could only turn afalseinto atrue.This also fixes the panic in #557. It came from
Olderadding the relative locktime to theu32::MAXheight used for unconfirmed inputs, asfinalize_psbtno longer goes throughOlder.Changelog notice
Wallet::finalize_psbtfinalizing PSBTs whosenLockTimeornSequencedoes not enforce the descriptor's timelock.SignOptions::assume_heightis deprecatedBefore submitting
Bugfixes
finalize_psbtpanics with "Overflowing addition" when spending an unconfirmed UTXO of a descriptor with anolder()branch #557 )