@@ -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 ( ) ,
@@ -6493,6 +6499,7 @@ impl Writeable for ChannelDetails {
6493
6499
( 6 , self . funding_txo, option) ,
6494
6500
( 7 , self . config, option) ,
6495
6501
( 8 , self . short_channel_id, option) ,
6502
+ ( 9 , self . confirmations, option) ,
6496
6503
( 10 , self . channel_value_satoshis, required) ,
6497
6504
( 12 , self . unspendable_punishment_reserve, option) ,
6498
6505
( 14 , user_channel_id_low, required) ,
@@ -6527,6 +6534,7 @@ impl Readable for ChannelDetails {
6527
6534
( 6 , funding_txo, option) ,
6528
6535
( 7 , config, option) ,
6529
6536
( 8 , short_channel_id, option) ,
6537
+ ( 9 , confirmations, option) ,
6530
6538
( 10 , channel_value_satoshis, required) ,
6531
6539
( 12 , unspendable_punishment_reserve, option) ,
6532
6540
( 14 , user_channel_id_low, required) ,
@@ -6570,6 +6578,7 @@ impl Readable for ChannelDetails {
6570
6578
next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
6571
6579
inbound_capacity_msat : inbound_capacity_msat. 0 . unwrap ( ) ,
6572
6580
confirmations_required,
6581
+ confirmations,
6573
6582
force_close_spend_delay,
6574
6583
is_outbound : is_outbound. 0 . unwrap ( ) ,
6575
6584
is_channel_ready : is_channel_ready. 0 . unwrap ( ) ,
0 commit comments