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