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 @@ -1080,7 +1080,8 @@ where
10801080 }
10811081 }
10821082
1083- let anchor_channel = channel_type. requires_anchors_zero_fee_htlc_tx ( ) ;
1083+ let anchor_channel = channel_type. requires_anchors_zero_fee_htlc_tx ( )
1084+ || channel_type. requires_anchor_zero_fee_commitments ( ) ;
10841085 if anchor_channel {
10851086 if let Some ( anchor_channels_config) =
10861087 self . config . anchor_channels_config . as_ref ( )
Original file line number Diff line number Diff line change @@ -1090,11 +1090,11 @@ impl Node {
10901090 . peer_by_node_id ( & node_id)
10911091 . ok_or ( Error :: ConnectionFailed ) ?
10921092 . init_features ;
1093+ let anchor_channel = init_features. requires_anchors_zero_fee_htlc_tx ( )
1094+ || init_features. requires_anchor_zero_fee_commitments ( ) ;
10931095 let required_funds_sats = channel_amount_sats
10941096 + self . config . anchor_channels_config . as_ref ( ) . map_or ( 0 , |c| {
1095- if init_features. requires_anchors_zero_fee_htlc_tx ( )
1096- && !c. trusted_peers_no_reserve . contains ( & node_id)
1097- {
1097+ if anchor_channel && !c. trusted_peers_no_reserve . contains ( & node_id) {
10981098 c. per_channel_reserve_sats
10991099 } else {
11001100 0
@@ -1619,9 +1619,10 @@ pub(crate) fn total_anchor_channels_reserve_sats(
16191619 !anchor_channels_config. trusted_peers_no_reserve . contains ( & c. counterparty . node_id )
16201620 && c. channel_shutdown_state
16211621 . map_or ( true , |s| s != ChannelShutdownState :: ShutdownComplete )
1622- && c. channel_type
1623- . as_ref ( )
1624- . map_or ( false , |t| t. requires_anchors_zero_fee_htlc_tx ( ) )
1622+ && c. channel_type . as_ref ( ) . map_or ( false , |t| {
1623+ t. requires_anchors_zero_fee_htlc_tx ( )
1624+ || t. requires_anchor_zero_fee_commitments ( )
1625+ } )
16251626 } )
16261627 . count ( ) as u64
16271628 * 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