File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -1076,7 +1076,8 @@ where
10761076 }
10771077 }
10781078
1079- let anchor_channel = channel_type. requires_anchors_zero_fee_htlc_tx ( ) ;
1079+ let anchor_channel = channel_type. requires_anchors_zero_fee_htlc_tx ( )
1080+ || channel_type. requires_anchor_zero_fee_commitments ( ) ;
10801081 if anchor_channel {
10811082 if let Some ( anchor_channels_config) =
10821083 self . config . anchor_channels_config . as_ref ( )
Original file line number Diff line number Diff line change @@ -1085,11 +1085,11 @@ impl Node {
10851085 . peer_by_node_id ( & node_id)
10861086 . ok_or ( Error :: ConnectionFailed ) ?
10871087 . init_features ;
1088+ let anchor_channel = init_features. requires_anchors_zero_fee_htlc_tx ( )
1089+ || init_features. requires_anchor_zero_fee_commitments ( ) ;
10881090 let required_funds_sats = channel_amount_sats
10891091 + self . config . anchor_channels_config . as_ref ( ) . map_or ( 0 , |c| {
1090- if init_features. requires_anchors_zero_fee_htlc_tx ( )
1091- && !c. trusted_peers_no_reserve . contains ( & node_id)
1092- {
1092+ if anchor_channel && !c. trusted_peers_no_reserve . contains ( & node_id) {
10931093 c. per_channel_reserve_sats
10941094 } else {
10951095 0
@@ -1614,9 +1614,10 @@ pub(crate) fn total_anchor_channels_reserve_sats(
16141614 !anchor_channels_config. trusted_peers_no_reserve . contains ( & c. counterparty . node_id )
16151615 && c. channel_shutdown_state
16161616 . map_or ( true , |s| s != ChannelShutdownState :: ShutdownComplete )
1617- && c. channel_type
1618- . as_ref ( )
1619- . map_or ( false , |t| t. requires_anchors_zero_fee_htlc_tx ( ) )
1617+ && c. channel_type . as_ref ( ) . map_or ( false , |t| {
1618+ t. requires_anchors_zero_fee_htlc_tx ( )
1619+ || t. requires_anchor_zero_fee_commitments ( )
1620+ } )
16201621 } )
16211622 . count ( ) as u64
16221623 * anchor_channels_config. per_channel_reserve_sats
Original file line number Diff line number Diff line change @@ -667,9 +667,11 @@ where
667667 total_anchor_channels_reserve_sats ( & self . channel_manager , & self . config ) ;
668668 let spendable_amount_sats =
669669 self . wallet . get_spendable_amount_sats ( cur_anchor_reserve_sats) . unwrap_or ( 0 ) ;
670+ let anchor_channel = init_features. requires_anchors_zero_fee_htlc_tx ( )
671+ || init_features. requires_anchor_zero_fee_commitments ( ) ;
670672 let required_funds_sats = channel_amount_sats
671673 + self . config . anchor_channels_config . as_ref ( ) . map_or ( 0 , |c| {
672- if init_features . requires_anchors_zero_fee_htlc_tx ( )
674+ if anchor_channel
673675 && !c. trusted_peers_no_reserve . contains ( & their_network_key)
674676 {
675677 c. per_channel_reserve_sats
You can’t perform that action at this time.
0 commit comments