Skip to content

Commit 5a04a84

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 41ffe61 commit 5a04a84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ enum FeeUpdateState {
138138
pub(super) fn second_stage_tx_fees_sat(
139139
channel_type: &ChannelTypeFeatures, feerate_sat_per_1000_weight: u32,
140140
) -> (u64, u64) {
141-
if channel_type.supports_anchors_zero_fee_htlc_tx() {
141+
if channel_type.supports_anchors_zero_fee_htlc_tx()
142+
|| channel_type.supports_anchor_zero_fee_commitments()
143+
{
142144
(0, 0)
143145
} else {
144146
(

0 commit comments

Comments
 (0)