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 @@ -635,21 +635,21 @@ impl ChannelDetails {
635635 pub ( crate ) fn from_ldk (
636636 value : LdkChannelDetails , anchor_channels_config : Option < & AnchorChannelsConfig > ,
637637 ) -> Self {
638- let is_anchor_channel =
639- value. channel_type . as_ref ( ) . map_or ( false , |ct| ct. supports_anchors_zero_fee_htlc_tx ( ) ) ;
640-
641- let reserve_type = if is_anchor_channel {
642- let is_trusted = anchor_channels_config. map_or ( false , |c| {
643- c. trusted_peers_no_reserve . contains ( & value. counterparty . node_id )
644- } ) ;
645- if is_trusted {
646- ReserveType :: TrustedPeersNoReserve
638+ let reserve_type =
639+ if value. channel_type . as_ref ( ) . is_some_and ( |ct| ct. supports_anchors_zero_fee_htlc_tx ( ) )
640+ {
641+ if let Some ( config) = anchor_channels_config {
642+ if config. trusted_peers_no_reserve . contains ( & value. counterparty . node_id ) {
643+ ReserveType :: TrustedPeersNoReserve
644+ } else {
645+ ReserveType :: Adaptive
646+ }
647+ } else {
648+ ReserveType :: Adaptive
649+ }
647650 } else {
648- ReserveType :: Adaptive
649- }
650- } else {
651- ReserveType :: Legacy
652- } ;
651+ ReserveType :: Legacy
652+ } ;
653653
654654 ChannelDetails {
655655 channel_id : value. channel_id ,
You can’t perform that action at this time.
0 commit comments