Skip to content

Commit 2a9b187

Browse files
committed
ln: set zero second stage fees for zero fee commitments
Update second_stage_tx_fees_sat to return zero for zero fee commitments. As is the case for anchors_zero_fee_commitments, this changes ensures that we won't trim the second stage transaction fee off of the HTLC amount.
1 parent d8a3727 commit 2a9b187

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ pub(crate) fn commit_tx_fee_sat(feerate_per_kw: u32, num_htlcs: usize, channel_t
239239
pub(super) fn second_stage_tx_fees_sat(
240240
channel_type: &ChannelTypeFeatures, feerate_sat_per_1000_weight: u32,
241241
) -> (u64, u64) {
242-
if channel_type.supports_anchors_zero_fee_htlc_tx() {
242+
if channel_type.supports_anchors_zero_fee_htlc_tx()
243+
|| channel_type.supports_anchor_zero_fee_commitments()
244+
{
243245
(0, 0)
244246
} else {
245247
(

0 commit comments

Comments
 (0)