Skip to content

Update BnB upper bound to use min_viable_change #26466

@S3RK

Description

@S3RK

Context:
SelectCoinsBnB uses cost_of_change as the upper bound for the search of changeless solution. However when building a tx the actual range for dropping change is determined by min_viable_change and change_fee (see SelectionResult::GetChange).

min_viable_change = std::max(change_spend_fee + 1, dust);
cost_of_change = change_spend_fee + change_fee;

That means that BnB forgoes some of the changeless solutions in cases when dust threshold is higher than change_spend_fee.

Proposal:
Update BnB upper bound to be consistent with tx building, i.e. it should use exactly the same threshold for when the change is viable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions