File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -605,21 +605,21 @@ impl ChannelDetails {
605605 pub ( crate ) fn from_ldk (
606606 value : LdkChannelDetails , anchor_channels_config : Option < & AnchorChannelsConfig > ,
607607 ) -> Self {
608- let is_anchor_channel =
609- value. channel_type . as_ref ( ) . map_or ( false , |ct| ct. supports_anchors_zero_fee_htlc_tx ( ) ) ;
610-
611- let reserve_type = if is_anchor_channel {
612- let is_trusted = anchor_channels_config. map_or ( false , |c| {
613- c. trusted_peers_no_reserve . contains ( & value. counterparty . node_id )
614- } ) ;
615- if is_trusted {
616- ReserveType :: TrustedPeersNoReserve
608+ let reserve_type =
609+ if value. channel_type . as_ref ( ) . is_some_and ( |ct| ct. supports_anchors_zero_fee_htlc_tx ( ) )
610+ {
611+ if let Some ( config) = anchor_channels_config {
612+ if config. trusted_peers_no_reserve . contains ( & value. counterparty . node_id ) {
613+ ReserveType :: TrustedPeersNoReserve
614+ } else {
615+ ReserveType :: Adaptive
616+ }
617+ } else {
618+ ReserveType :: Adaptive
619+ }
617620 } else {
618- ReserveType :: Adaptive
619- }
620- } else {
621- ReserveType :: Legacy
622- } ;
621+ ReserveType :: Legacy
622+ } ;
623623
624624 ChannelDetails {
625625 channel_id : value. channel_id ,
You can’t perform that action at this time.
0 commit comments