@@ -1141,6 +1141,10 @@ pub struct ChannelDetails {
1141
1141
/// [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
1142
1142
/// [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
1143
1143
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 > ,
1144
1148
/// The number of blocks (after our commitment transaction confirms) that we will need to wait
1145
1149
/// until we can claim our funds after we force-close the channel. During this time our
1146
1150
/// 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
1817
1821
let mut res = Vec :: new ( ) ;
1818
1822
{
1819
1823
let channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
1824
+ let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
1820
1825
res. reserve ( channel_state. by_id . len ( ) ) ;
1821
1826
for ( channel_id, channel) in channel_state. by_id . iter ( ) . filter ( f) {
1822
1827
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
1853
1858
next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
1854
1859
user_channel_id : channel. get_user_id ( ) ,
1855
1860
confirmations_required : channel. minimum_depth ( ) ,
1861
+ confirmations : Some ( channel. get_funding_tx_confirmations ( best_block_height) ) ,
1856
1862
force_close_spend_delay : channel. get_counterparty_selected_contest_delay ( ) ,
1857
1863
is_outbound : channel. is_outbound ( ) ,
1858
1864
is_channel_ready : channel. is_usable ( ) ,
@@ -6510,6 +6516,7 @@ impl Writeable for ChannelDetails {
6510
6516
( 6 , self . funding_txo, option) ,
6511
6517
( 7 , self . config, option) ,
6512
6518
( 8 , self . short_channel_id, option) ,
6519
+ ( 9 , self . confirmations, option) ,
6513
6520
( 10 , self . channel_value_satoshis, required) ,
6514
6521
( 12 , self . unspendable_punishment_reserve, option) ,
6515
6522
( 14 , user_channel_id_low, required) ,
@@ -6544,6 +6551,7 @@ impl Readable for ChannelDetails {
6544
6551
( 6 , funding_txo, option) ,
6545
6552
( 7 , config, option) ,
6546
6553
( 8 , short_channel_id, option) ,
6554
+ ( 9 , confirmations, option) ,
6547
6555
( 10 , channel_value_satoshis, required) ,
6548
6556
( 12 , unspendable_punishment_reserve, option) ,
6549
6557
( 14 , user_channel_id_low, required) ,
@@ -6587,6 +6595,7 @@ impl Readable for ChannelDetails {
6587
6595
next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
6588
6596
inbound_capacity_msat : inbound_capacity_msat. 0 . unwrap ( ) ,
6589
6597
confirmations_required,
6598
+ confirmations,
6590
6599
force_close_spend_delay,
6591
6600
is_outbound : is_outbound. 0 . unwrap ( ) ,
6592
6601
is_channel_ready : is_channel_ready. 0 . unwrap ( ) ,
0 commit comments