@@ -1865,7 +1865,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1865
1865
/// its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
1866
1866
///
1867
1867
/// 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.
1869
1869
pub fn is_fully_resolved < L : Logger > ( & self , logger : & L ) -> bool {
1870
1870
let mut is_all_funds_claimed = self . get_claimable_balances ( ) . is_empty ( ) ;
1871
1871
let current_height = self . current_best_block ( ) . height ;
@@ -1878,10 +1878,10 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1878
1878
}
1879
1879
}
1880
1880
1881
+ const BLOCKS_THRESHOLD : u32 = 4032 ; // ~four weeks
1881
1882
match ( inner. balances_empty_height , is_all_funds_claimed) {
1882
1883
( Some ( balances_empty_height) , true ) => {
1883
1884
// Claimed all funds, check if reached the blocks threshold.
1884
- const BLOCKS_THRESHOLD : u32 = 4032 ; // ~four weeks
1885
1885
return current_height >= balances_empty_height + BLOCKS_THRESHOLD ;
1886
1886
} ,
1887
1887
( Some ( _) , false ) => {
@@ -1897,6 +1897,9 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1897
1897
( None , true ) => {
1898
1898
// Claimed all funds but `balances_empty_height` is None. It is set to the
1899
1899
// 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 ) ;
1900
1903
inner. balances_empty_height = Some ( current_height) ;
1901
1904
false
1902
1905
} ,
0 commit comments