@@ -1141,6 +1141,10 @@ pub struct ChannelDetails {
11411141 /// [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
11421142 /// [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
11431143 pub confirmations_required : Option < u32 > ,
1144+ /// The current number of confirmations on the funding transaction.
1145+ ///
1146+ /// This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
1147+ pub confirmations : Option < u32 > ,
11441148 /// The number of blocks (after our commitment transaction confirms) that we will need to wait
11451149 /// until we can claim our funds after we force-close the channel. During this time our
11461150 /// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
@@ -1817,6 +1821,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
18171821 let mut res = Vec :: new ( ) ;
18181822 {
18191823 let channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
1824+ let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
18201825 res. reserve ( channel_state. by_id . len ( ) ) ;
18211826 for ( channel_id, channel) in channel_state. by_id . iter ( ) . filter ( f) {
18221827 let balance = channel. get_available_balances ( ) ;
@@ -1853,6 +1858,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
18531858 next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
18541859 user_channel_id : channel. get_user_id ( ) ,
18551860 confirmations_required : channel. minimum_depth ( ) ,
1861+ confirmations : Some ( channel. get_funding_tx_confirmations ( best_block_height) ) ,
18561862 force_close_spend_delay : channel. get_counterparty_selected_contest_delay ( ) ,
18571863 is_outbound : channel. is_outbound ( ) ,
18581864 is_channel_ready : channel. is_usable ( ) ,
@@ -6493,6 +6499,7 @@ impl Writeable for ChannelDetails {
64936499 ( 6 , self . funding_txo, option) ,
64946500 ( 7 , self . config, option) ,
64956501 ( 8 , self . short_channel_id, option) ,
6502+ ( 9 , self . confirmations, option) ,
64966503 ( 10 , self . channel_value_satoshis, required) ,
64976504 ( 12 , self . unspendable_punishment_reserve, option) ,
64986505 ( 14 , user_channel_id_low, required) ,
@@ -6527,6 +6534,7 @@ impl Readable for ChannelDetails {
65276534 ( 6 , funding_txo, option) ,
65286535 ( 7 , config, option) ,
65296536 ( 8 , short_channel_id, option) ,
6537+ ( 9 , confirmations, option) ,
65306538 ( 10 , channel_value_satoshis, required) ,
65316539 ( 12 , unspendable_punishment_reserve, option) ,
65326540 ( 14 , user_channel_id_low, required) ,
@@ -6570,6 +6578,7 @@ impl Readable for ChannelDetails {
65706578 next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
65716579 inbound_capacity_msat : inbound_capacity_msat. 0 . unwrap ( ) ,
65726580 confirmations_required,
6581+ confirmations,
65736582 force_close_spend_delay,
65746583 is_outbound : is_outbound. 0 . unwrap ( ) ,
65756584 is_channel_ready : is_channel_ready. 0 . unwrap ( ) ,
0 commit comments