File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -636,21 +636,21 @@ impl ChannelDetails {
636636 pub ( crate ) fn from_ldk (
637637 value : LdkChannelDetails , anchor_channels_config : Option < & AnchorChannelsConfig > ,
638638 ) -> Self {
639- let is_anchor_channel =
640- value. channel_type . as_ref ( ) . map_or ( false , |ct| ct. supports_anchors_zero_fee_htlc_tx ( ) ) ;
641-
642- let reserve_type = if is_anchor_channel {
643- let is_trusted = anchor_channels_config. map_or ( false , |c| {
644- c. trusted_peers_no_reserve . contains ( & value. counterparty . node_id )
645- } ) ;
646- if is_trusted {
647- ReserveType :: TrustedPeersNoReserve
639+ let reserve_type =
640+ if value. channel_type . as_ref ( ) . is_some_and ( |ct| ct. supports_anchors_zero_fee_htlc_tx ( ) )
641+ {
642+ if let Some ( config) = anchor_channels_config {
643+ if config. trusted_peers_no_reserve . contains ( & value. counterparty . node_id ) {
644+ ReserveType :: TrustedPeersNoReserve
645+ } else {
646+ ReserveType :: Adaptive
647+ }
648+ } else {
649+ ReserveType :: Adaptive
650+ }
648651 } else {
649- ReserveType :: Adaptive
650- }
651- } else {
652- ReserveType :: Legacy
653- } ;
652+ ReserveType :: Legacy
653+ } ;
654654
655655 ChannelDetails {
656656 channel_id : value. channel_id ,
You can’t perform that action at this time.
0 commit comments