@@ -1146,6 +1146,10 @@ pub struct ChannelDetails {
1146
1146
/// [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
1147
1147
/// [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
1148
1148
pub confirmations_required : Option < u32 > ,
1149
+ /// The current number of confirmations on the funding transaction.
1150
+ ///
1151
+ /// This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
1152
+ pub confirmations : Option < u32 > ,
1149
1153
/// The number of blocks (after our commitment transaction confirms) that we will need to wait
1150
1154
/// until we can claim our funds after we force-close the channel. During this time our
1151
1155
/// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
@@ -1694,6 +1698,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
1694
1698
let mut res = Vec :: new ( ) ;
1695
1699
{
1696
1700
let channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
1701
+ let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
1697
1702
res. reserve ( channel_state. by_id . len ( ) ) ;
1698
1703
for ( channel_id, channel) in channel_state. by_id . iter ( ) . filter ( f) {
1699
1704
let balance = channel. get_available_balances ( ) ;
@@ -1730,6 +1735,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
1730
1735
next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
1731
1736
user_channel_id : channel. get_user_id ( ) ,
1732
1737
confirmations_required : channel. minimum_depth ( ) ,
1738
+ confirmations : Some ( channel. get_funding_tx_confirmations ( best_block_height) ) ,
1733
1739
force_close_spend_delay : channel. get_counterparty_selected_contest_delay ( ) ,
1734
1740
is_outbound : channel. is_outbound ( ) ,
1735
1741
is_channel_ready : channel. is_usable ( ) ,
@@ -6467,6 +6473,7 @@ impl Writeable for ChannelDetails {
6467
6473
( 6 , self . funding_txo, option) ,
6468
6474
( 7 , self . config, option) ,
6469
6475
( 8 , self . short_channel_id, option) ,
6476
+ ( 9 , self . confirmations, option) ,
6470
6477
( 10 , self . channel_value_satoshis, required) ,
6471
6478
( 12 , self . unspendable_punishment_reserve, option) ,
6472
6479
( 14 , user_channel_id_low, required) ,
@@ -6501,6 +6508,7 @@ impl Readable for ChannelDetails {
6501
6508
( 6 , funding_txo, option) ,
6502
6509
( 7 , config, option) ,
6503
6510
( 8 , short_channel_id, option) ,
6511
+ ( 9 , confirmations, option) ,
6504
6512
( 10 , channel_value_satoshis, required) ,
6505
6513
( 12 , unspendable_punishment_reserve, option) ,
6506
6514
( 14 , user_channel_id_low, required) ,
@@ -6544,6 +6552,7 @@ impl Readable for ChannelDetails {
6544
6552
next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
6545
6553
inbound_capacity_msat : inbound_capacity_msat. 0 . unwrap ( ) ,
6546
6554
confirmations_required,
6555
+ confirmations,
6547
6556
force_close_spend_delay,
6548
6557
is_outbound : is_outbound. 0 . unwrap ( ) ,
6549
6558
is_channel_ready : is_channel_ready. 0 . unwrap ( ) ,
0 commit comments