You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jp1ac4@darosior I'm working on some breaking changes to the API.
After a discussion with @LLFourn, we've decided to include DrainWeights in Target and keep Target in the CoinSelector. This simplifies the API and gives us an easy pathway to take into account the output count varint weight changes when including the drain output.
How this simplifies the API:
The target & drain weights are included in the CoinSelector, so they don't need to be passed in as method inputs.
Change policy can be simplified to just: Fn(&CoinSelector) -> bool.
How we can take into account the output varint weight changes when including drain:
So in my mind Target and DrainWeights would still be separate things just both exposed and settable publicly. Target would include the number of outputs and DrainWeights would include the number of outputs in the draining output. I also think you need to include the "base weight" in Target as it is coupled to the number of outputs.
Now I thought further -- if we create this invariant I think this also allows us to reduce the change_policy to a single integer -- i.e. the threshold of excess coin which should trigger the inclusion of the drain output. Wdyt @evanlinjin?
Original discussion: bitcoindevkit/bdk#1072 (comment)
@jp1ac4 @darosior I'm working on some breaking changes to the API.
After a discussion with @LLFourn, we've decided to include
DrainWeights
inTarget
and keepTarget
in theCoinSelector
. This simplifies the API and gives us an easy pathway to take into account the output count varint weight changes when including the drain output.How this simplifies the API:
CoinSelector
, so they don't need to be passed in as method inputs.Fn(&CoinSelector) -> bool
.How we can take into account the output varint weight changes when including drain:
This calculates the
base_weight
and thedrain_weight
(which includes output varint changes) that are both included inTarget
.The text was updated successfully, but these errors were encountered: