File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -587,17 +587,19 @@ pub struct ChannelDetails {
587587 pub channel_shutdown_state : Option < ChannelShutdownState > ,
588588 /// The type of on-chain reserve maintained for this channel.
589589 ///
590+ /// Will be `None` until channel negotiation has completed and determined whether
591+ /// this channel uses anchor or legacy reserve behavior.
592+ ///
590593 /// See [`ReserveType`] for details on how reserves differ between anchor and legacy channels.
591- pub reserve_type : ReserveType ,
594+ pub reserve_type : Option < ReserveType > ,
592595}
593596
594597impl ChannelDetails {
595598 pub ( crate ) fn from_ldk (
596599 value : LdkChannelDetails , anchor_channels_config : Option < & AnchorChannelsConfig > ,
597600 ) -> Self {
598- let reserve_type =
599- if value. channel_type . as_ref ( ) . is_some_and ( |ct| ct. supports_anchors_zero_fee_htlc_tx ( ) )
600- {
601+ let reserve_type = value. channel_type . as_ref ( ) . map ( |channel_type| {
602+ if channel_type. supports_anchors_zero_fee_htlc_tx ( ) {
601603 if let Some ( config) = anchor_channels_config {
602604 if config. trusted_peers_no_reserve . contains ( & value. counterparty . node_id ) {
603605 ReserveType :: TrustedPeersNoReserve
@@ -616,7 +618,8 @@ impl ChannelDetails {
616618 }
617619 } else {
618620 ReserveType :: Legacy
619- } ;
621+ }
622+ } ) ;
620623
621624 ChannelDetails {
622625 channel_id : value. channel_id ,
You can’t perform that action at this time.
0 commit comments