diff options
author | W. J. van der Laan <laanwj@protonmail.com> | 2021-09-27 14:24:00 +0200 |
---|---|---|
committer | W. J. van der Laan <laanwj@protonmail.com> | 2021-09-27 14:24:06 +0200 |
commit | 07e743edd013364de7c198c14ad91137eede5fd5 (patch) | |
tree | a821bfdfc500d930a6d40be43cd6ffc34a9a1fd3 | |
parent | eabc2c482aad6e6f9781211d03720752a5b715be (diff) | |
parent | d2eccacd188959c5aed661d0d5b39c119e7c7a32 (diff) | |
download | bitcoin-07e743edd013364de7c198c14ad91137eede5fd5.tar.xz |
Merge bitcoin/bitcoin#22892: doc: Clarify that change_cost cannot be negative in GetSelectionWaste
d2eccacd188959c5aed661d0d5b39c119e7c7a32 doc: Clarify that change_cost cannot be negative in GetSelectionWaste (benthecarman)
Pull request description:
We assert that the `change_cost` must be positive so we should document it in the function's docs
https://github.com/bitcoin/bitcoin/blob/4f5ad43b1e05cd7b403f87aae4c4d42e5aea810b/src/wallet/coinselection.cpp#L361
ACKs for top commit:
jonatack:
ACK d2eccacd188959c5aed661d0d5b39c119e7c7a32
jarolrod:
ACK d2eccacd188959c5aed661d0d5b39c119e7c7a32
shaavan:
ACK d2eccacd188959c5aed661d0d5b39c119e7c7a32
Tree-SHA512: 089bc41d7e212b811455527ce2ac83301eae0edc03933dcbd5229b22078827395c8e3bcfda0ba029b7c60705db3119b4f80e372842a6bd8dae195dbaa0b52833
-rw-r--r-- | src/wallet/coinselection.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h index 35617d455b..5ebf7d02a6 100644 --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -174,7 +174,9 @@ struct OutputGroup * change_cost = effective_feerate * change_output_size + long_term_feerate * change_spend_size * * @param[in] inputs The selected inputs - * @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. + * @param[in] change_cost The cost of creating change and spending it in the future. + * Only used if there is change, in which case it must be positive. + * Must be 0 if there is no change. * @param[in] target The amount targeted by the coin selection algorithm. * @param[in] use_effective_value Whether to use the input's effective value (when true) or the real value (when false). * @return The waste |