Integrate package context into fee and weight calculations#38
Draft
evanlinjin wants to merge 1 commit intobitcoindevkit:masterfrom
Draft
Integrate package context into fee and weight calculations#38evanlinjin wants to merge 1 commit intobitcoindevkit:masterfrom
evanlinjin wants to merge 1 commit intobitcoindevkit:masterfrom
Conversation
When a Package is set via with_package(), all fee and weight calculations now automatically include parent transaction context: - weight() returns child_weight + parent_weight - fee() returns child_fee + parent_fee - implied_feerate() returns package feerate New methods for when child-only values are needed: - weight_without_package() - fee_without_package() - package() accessor RBF calculations (replacement_excess) use child weight only since Bitcoin's RBF rule 4 applies to the replacing transaction, not the package. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6b6a402 to
ee587da
Compare
aagbotemi
reviewed
Feb 16, 2026
Contributor
aagbotemi
left a comment
There was a problem hiding this comment.
The approach of adding Package to CoinSelector is good one and works well for the UTXO selection for CPFP use case.
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.
When a Package is set via with_package(), all fee and weight calculations now automatically include parent transaction context:
New methods for when child-only values are needed:
RBF calculations (replacement_excess) use child weight only since Bitcoin's RBF rule 4 applies to the replacing transaction, not the package.