-
Notifications
You must be signed in to change notification settings - Fork 46
fix(wallet): Don't fail in build_fee_bump for missing parent txid
#337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(wallet): Don't fail in build_fee_bump for missing parent txid
#337
Conversation
Pull Request Test Coverage Report for Build 19005356703Details
💛 - Coveralls |
nymius
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK 8a08bf5
f143e1f to
592217f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #337 +/- ##
==========================================
+ Coverage 84.81% 85.24% +0.43%
==========================================
Files 23 23
Lines 8145 8229 +84
==========================================
+ Hits 6908 7015 +107
+ Misses 1237 1214 -23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I see this PR is in the "Wallet 2.3.0" milestone but merging to the |
deps: Bump `bitcoin` to 0.32.7 to make use of `ScriptBuf::new_p2a`.
This fixes an issue that made using `build_fee_bump` impossible if the original transaction was created using `add_foreign_utxo`. Note that it is still required for the previous txouts to exist in the TxGraph in order to calculate the fee / feerate of the original transaction, and to populate the witness utxo, etc. In the future this process could be improved by changing `add_foreign_utxo` to automatically insert the foreign txout into the wallet, but to avoid scope creep that change is left out of this patch.
592217f to
f15582d
Compare
I would consider backporting to 2.3.0 assuming it also makes sense on master. |
| .ok_or(BuildFeeBumpError::UnknownUtxo(outpoint))?; | ||
| match txout_index.index_of_spk(prev_txout.script_pubkey.clone()) { | ||
| Some(&(keychain, derivation_index)) => { | ||
| let txout = prev_txout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not rename prev_txout -> txout altogether?
| .collect(); | ||
|
|
||
| let mut tx = graph | ||
| let mut tx = tx_graph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tx request here and the conditional below could be reduced to the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f15582d
I left some comments, but the issue this PR is addressing is already fixed by the changes.
Description
Previously
build_fee_bumpcould error withUnknownUtxoif a parent of the tx being fee-bumped wasn't found in the wallet. This made it impossible to usebuild_fee_bumpon a transaction created usingadd_foreign_utxo. This PR is a refactor ofbuild_fee_bumpthat manages to avoid the error by instead querying the tx graph for the txout specifically. This is a reasonable assumption because the previous txouts are necessary to compute the fee of the original tx.I've included a test in 992a08f to demonstrate the old behavior which now passes.
may resolve #325.
Notes to the reviewers
Changelog notice
Wallet::build_fee_bumpto enable fee-bumping a tx which contains a foreign UTXO.Checklists
All Submissions:
New Features:
Bugfixes:
[ ] This pull request breaks the existing API