feat(wallet): add configurable min_output_value filter#427
Open
noahjoeris wants to merge 2 commits intobitcoindevkit:masterfrom
Open
feat(wallet): add configurable min_output_value filter#427noahjoeris wants to merge 2 commits intobitcoindevkit:masterfrom
noahjoeris wants to merge 2 commits intobitcoindevkit:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #427 +/- ##
==========================================
+ Coverage 80.04% 80.29% +0.25%
==========================================
Files 24 24
Lines 5336 5395 +59
Branches 242 245 +3
==========================================
+ Hits 4271 4332 +61
+ Misses 987 984 -3
- Partials 78 79 +1
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:
|
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
Adds a runtime-only
min_output_value: Option<Amount>setting toWalletthat filters outputs below a chosen threshold across wallet queries and coin selection. Useful for applications that want to ignore dust/spam outputs without reimplementing BDK's internal logic.Closes #375
Affected methods:
balance,list_unspent,list_output,sent_and_received,net_value,tx_details, and coin selection.get_utxoand fee calculations are intentionally not filtered.Notes to the reviewers
min_output_valuerather thandust_thresholdto avoid confusion with the existing coin selectiondust_thresholdand Bitcoin's relay dust policy.CreateParams::min_output_value()/LoadParams::min_output_value(), or changed at runtime viaWallet::set_min_output_value()bdk_wallet, not pushed down intobdk_chain. The trade-off is that some methods are no longer thin wrappers aroundbdk_chain. This can be refactored downstream if desired.Changelog notice
min_output_valuesupport toWallet,CreateParams, andLoadParamsWallet::net_valuebalance,list_unspent,list_output,sent_and_received,net_value, and coin selection now honormin_output_valueChecklists
All Submissions:
just pbefore pushingNew Features: