@@ -1865,7 +1865,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
18651865 /// its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
18661866 ///
18671867 /// This function returns true only if [`Self::get_claimable_balances`] has been empty for at least
1868- /// 2016 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
1868+ /// 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
18691869 pub fn is_fully_resolved < L : Logger > ( & self , logger : & L ) -> bool {
18701870 let mut is_all_funds_claimed = self . get_claimable_balances ( ) . is_empty ( ) ;
18711871 let current_height = self . current_best_block ( ) . height ;
@@ -1878,10 +1878,10 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
18781878 }
18791879 }
18801880
1881+ const BLOCKS_THRESHOLD : u32 = 4032 ; // ~four weeks
18811882 match ( inner. balances_empty_height , is_all_funds_claimed) {
18821883 ( Some ( balances_empty_height) , true ) => {
18831884 // Claimed all funds, check if reached the blocks threshold.
1884- const BLOCKS_THRESHOLD : u32 = 4032 ; // ~four weeks
18851885 return current_height >= balances_empty_height + BLOCKS_THRESHOLD ;
18861886 } ,
18871887 ( Some ( _) , false ) => {
@@ -1897,6 +1897,9 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
18971897 ( None , true ) => {
18981898 // Claimed all funds but `balances_empty_height` is None. It is set to the
18991899 // current block height.
1900+ log_debug ! ( logger,
1901+ "ChannelMonitor funded at {} is now fully resolved. It will become archivable in {} blocks" ,
1902+ inner. get_funding_txo( ) . 0 , BLOCKS_THRESHOLD ) ;
19001903 inner. balances_empty_height = Some ( current_height) ;
19011904 false
19021905 } ,
0 commit comments