]> git.bitcoin.ninja Git - rust-lightning/commit
Handle under-coin-selecting due to an added OP_RETURN output
authorMatt Corallo <git@bluematt.me>
Thu, 29 Aug 2024 20:43:10 +0000 (20:43 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 3 Sep 2024 14:15:28 +0000 (14:15 +0000)
commitd383ac49a27a785ad93135bbe8e650704649f6af
tree67c31d1e159b94765d9a0198bbf42485c8afd27f
parentff00c63171f614cdf38dfe4535736eef90751d61
Handle under-coin-selecting due to an added OP_RETURN output

When we do coin selection for channel close anchor spends, we may
do coin selection targeting exactly the input values we need.
However, if coin selection does not include a change output, we may
add an OP_RETURN output, which may cause us to end up with less
fee than we wanted on the resulting package.

Here we address this issue by running coin selection twice - first
without seeking the extra weight of the OP_RETURN output, and again
if we find that we under-selected.
lightning/src/events/bump_transaction.rs