Skip to content

Commit d2eccac

Browse files
committed
doc: Clarify that change_cost cannot be negative in GetSelectionWaste
1 parent f4e12fd commit d2eccac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wallet/coinselection.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ struct OutputGroup
174174
* change_cost = effective_feerate * change_output_size + long_term_feerate * change_spend_size
175175
*
176176
* @param[in] inputs The selected inputs
177-
* @param[in] change_cost The cost of creating change and spending it in the future. Only used if there is change. Must be 0 if there is no change.
177+
* @param[in] change_cost The cost of creating change and spending it in the future.
178+
* Only used if there is change, in which case it must be positive.
179+
* Must be 0 if there is no change.
178180
* @param[in] target The amount targeted by the coin selection algorithm.
179181
* @param[in] use_effective_value Whether to use the input's effective value (when true) or the real value (when false).
180182
* @return The waste

0 commit comments

Comments
 (0)