fix(abstract-utxo): improve fee calculation and refactor backup key recovery#7771
Merged
OttoAllmendinger merged 6 commits intomasterfrom Dec 18, 2025
Merged
fix(abstract-utxo): improve fee calculation and refactor backup key recovery#7771OttoAllmendinger merged 6 commits intomasterfrom
OttoAllmendinger merged 6 commits intomasterfrom
Conversation
Extract hard-coded fee rates into named constants for better maintainability and clarity. Use these constants in the recovery functions to ensure consistent fee calculation. Issue: BTC-2891 Co-authored-by: llm-git <llm-git@ttll.de>
Add test case to verify the actual fee rate used in backup key recovery transactions. This ensures that the fee calculation logic is working as expected. Note that basically all tests fail because fee calculation is utterly broken. Issue: BTC-2891 Co-authored-by: llm-git <llm-git@ttll.de>
Fix dimension calculation for backup key recovery to include the recovery destination output. Without this, the approximated transaction fee would be incorrect, potentially creating transactions with insufficient fees. Issue: BTC-2891 Co-authored-by: llm-git <llm-git@ttll.de>
Set a consistent fee rate for all backup key recovery tests. Remove test that used a different fee rate since it's no longer needed. Issue: BTC-2891 Co-authored-by: llm-git <llm-git@ttll.de>
Only add KRS fee output to dimensions if KRS fee is greater than zero. Issue: BTC-2891 Co-authored-by: llm-git <llm-git@ttll.de>
Extract PSBT creation logic to separate functions for better maintainability and testability. Improves error handling for insufficient funds and adds proper type annotations for fee parameters. Issue: BTC-2891 Co-authored-by: llm-git <llm-git@ttll.de>
davidkaplanbitgo
approved these changes
Dec 18, 2025
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.
This PR focuses on fixing fee calculation issues in the backup key recovery
functionality and refactoring related code for better maintainability. The
changes include:
destination output
These changes ensure proper fee calculation for backup key recovery
transactions, preventing potential issues with insufficient fees and
improving overall code quality.
BTC-2891