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 is to resolve #923.
The
score
method of theLowestFee
metric has been fixed upstream and so our temporary partial fix from #867 is no longer required.The
min_fee
parameter ofselect_coins_for_spend
, if positive, now ensures that RBF rule 4 is satisfied. Accordingly, it has been renamed toreplaced_fee
and made anOption
. We could potentially have used theSpendTxFees
enum as a parameter directly instead offeerate_vb
andreplaced_fee
, butfeerate_vb
is currentlyf32
rather thanu64
and so I kept them as separate parameters.Thanks to how the
replaced_fee
parameter works, the fee iteration approach used inrbf_psbt
to ensure the replacement satisfies RBF rule 4 is no longer required.base_weight
is no longer stored inCoinSelector
and instead the output weights are stored inTarget
. This means that theoutput_weight
ofDrainWeights
no longer needs to take into account a potential change in output count varint as this is now handled by bdk_coin_select.The min value for change no longer includes the threshold itself and so we have to subtract 1 from our change policy's min value (see bitcoindevkit/coin-select#14 (comment)). We already have a test that fails without this subtraction as it expects a change output of 5000 sats.