Skip to content

Commit 12b794a

Browse files
committed
Abstract dust-vs-nondust HTLC sorting away from channel
Move these decisions to `TxBuilder` when calculating total dust exposure and total transaction fees. We would have liked to delete `TxBuilder::htlc_success_timeout_dust_limits`, but this is required in `get_available_balances` to potentially clamp the balance to the dust limit. Because this method is there, we also use it to determine whether a single HTLC is dust or nondust (otherwise we would have used a `TxBuilder::is_dust` call on that HTLC). Along the way, we also sort non-dust HTLCs in the holding cell using the exact proposed feerate in `can_send_update_fee`. When checking whether we can afford the next commitment transaction fee, we should not count HTLCs in the holding cell using the dust buffer feerate, as this can trim HTLCs that will be non-dust on the next commitment transaction. Rather we should use the exact proposed feerate; this ensures we account for all non-dust HTLCs on the next commitment transaction.
1 parent 2f9898c commit 12b794a

File tree

2 files changed

+235
-228
lines changed

2 files changed

+235
-228
lines changed

0 commit comments

Comments
 (0)