@@ -1145,6 +1145,10 @@ pub struct ChannelDetails {
11451145 /// [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
11461146 /// [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
11471147 pub confirmations_required : Option < u32 > ,
1148+ /// The current number of confirmations on the funding transaction.
1149+ ///
1150+ /// This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
1151+ pub confirmations : Option < u32 > ,
11481152 /// The number of blocks (after our commitment transaction confirms) that we will need to wait
11491153 /// until we can claim our funds after we force-close the channel. During this time our
11501154 /// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
@@ -1693,6 +1697,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
16931697 let mut res = Vec :: new ( ) ;
16941698 {
16951699 let channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
1700+ let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
16961701 res. reserve ( channel_state. by_id . len ( ) ) ;
16971702 for ( channel_id, channel) in channel_state. by_id . iter ( ) . filter ( f) {
16981703 let balance = channel. get_available_balances ( ) ;
@@ -1729,6 +1734,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
17291734 next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
17301735 user_channel_id : channel. get_user_id ( ) ,
17311736 confirmations_required : channel. minimum_depth ( ) ,
1737+ confirmations : Some ( channel. get_funding_tx_confirmations ( best_block_height) ) ,
17321738 force_close_spend_delay : channel. get_counterparty_selected_contest_delay ( ) ,
17331739 is_outbound : channel. is_outbound ( ) ,
17341740 is_channel_ready : channel. is_usable ( ) ,
@@ -6467,6 +6473,7 @@ impl Writeable for ChannelDetails {
64676473 ( 6 , self . funding_txo, option) ,
64686474 ( 7 , self . config, option) ,
64696475 ( 8 , self . short_channel_id, option) ,
6476+ ( 9 , self . confirmations, option) ,
64706477 ( 10 , self . channel_value_satoshis, required) ,
64716478 ( 12 , self . unspendable_punishment_reserve, option) ,
64726479 ( 14 , user_channel_id_low, required) ,
@@ -6501,6 +6508,7 @@ impl Readable for ChannelDetails {
65016508 ( 6 , funding_txo, option) ,
65026509 ( 7 , config, option) ,
65036510 ( 8 , short_channel_id, option) ,
6511+ ( 9 , confirmations, option) ,
65046512 ( 10 , channel_value_satoshis, required) ,
65056513 ( 12 , unspendable_punishment_reserve, option) ,
65066514 ( 14 , user_channel_id_low, required) ,
@@ -6544,6 +6552,7 @@ impl Readable for ChannelDetails {
65446552 next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
65456553 inbound_capacity_msat : inbound_capacity_msat. 0 . unwrap ( ) ,
65466554 confirmations_required,
6555+ confirmations,
65476556 force_close_spend_delay,
65486557 is_outbound : is_outbound. 0 . unwrap ( ) ,
65496558 is_channel_ready : is_channel_ready. 0 . unwrap ( ) ,
0 commit comments