Repository navigation
fix: avoid panic for invalid chain tip height - #592
Chibey-max wants to merge 2 commits into
Conversation
|
Thanks for working on this @Chibey-max! I tested it locally. The new regression test panics on master with invalid height and passes on this branch, so the out-of-range chain tip no longer crashes One concern: considering that a tip above 500M probably points to an error from the chain source, would it not be better to return a |
@Jennycj Thanks for testing this and confirming the regression behavior. I agree that returning a dedicated CreateTxError would make an invalid chain tip more explicit than silently falling back to locktime zero. I initially used zero to preserve transaction creation without a panic, but I’m happy to update the implementation to return an InvalidChainTipHeight error and adjust the regression test accordingly. |
Thanks for testing and for the suggestion. I agree that returning an explicit error is clearer than silently falling back to locktime zero. I updated the PR to add CreateTxError::InvalidChainTipHeight and changed the regression test to assert that error. The update is in commit 233b728. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #592 +/- ##
==========================================
- Coverage 81.87% 81.87% -0.01%
==========================================
Files 25 25
Lines 6291 6294 +3
Branches 302 302
==========================================
+ Hits 5151 5153 +2
- Misses 1035 1036 +1
Partials 105 105
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:
|
|
@Chibey-max please rebase to pick up the latest commits on master! Note that your commits are also not PGP-signed, which is a requirement for this library. Thanks! |
233b728 to
71f2d9d
Compare
Thanks !!. I rebased onto the latest |
Closes #550
Description
Fixes a panic in transaction creation when the wallet chain tip height cannot be represented as a block-based locktime. The raw chain height remains available for coinbase maturity and UTXO filtering, while fee-sniping locktime falls back to
LockTime::ZEROwhen conversion is not possible.Notes to the reviewers
The regression test uses an out-of-range chain tip height and verifies that transaction creation does not panic and produces a zero locktime. This change does not add a new public error variant.
Before submitting