[#wallet-SelectionResult-RecalculateWaste] = xref:wallet.adoc[wallet]::xref:wallet/SelectionResult.adoc[SelectionResult]::RecalculateWaste :relfileprefix: ../../ :mrdocs: Calculates and stores the waste for this result given the cost of change and the opportunity cost of spending these inputs now vs in the future. If change exists, waste = change_cost + inputs * (effective_feerate ‐ long_term_feerate) ‐ bump_fee_group_discount If no change, waste = excess + inputs * (effective_feerate ‐ long_term_feerate) ‐ bump_fee_group_discount where excess = selected_effective_value ‐ target change_cost = effective_feerate * change_output_size + long_term_feerate * change_spend_size == Synopsis Declared in `<wallet/coinselection.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void RecalculateWaste( xref:CAmount.adoc[CAmount] min_viable_change, xref:CAmount.adoc[CAmount] change_cost, xref:CAmount.adoc[CAmount] change_fee); ---- == Parameters [cols="1,4"] |=== | Name| Description | *min_viable_change* [in] | The minimum amount necessary to make a change output economic | *change_cost* [in] | The cost of creating a change output and spending it in the future. Only used if there is change, in which case it must be non‐negative. | *change_fee* [in] | The fee for creating a change output |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#