X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fchannelmonitor.rs;h=a7c88cd08a220ecf4f2698c8ce045759cea6ab27;hb=2b14cc40a6acf226aafaddd0efe67264c0df706f;hp=c05b6b309221f6b61c1c2a1eefdace52b705dd99;hpb=195e666953afef108ed4c47abba8b6414f8f15fc;p=rust-lightning diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index c05b6b30..a7c88cd0 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -1865,7 +1865,7 @@ impl ChannelMonitor { /// its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set). /// /// This function returns true only if [`Self::get_claimable_balances`] has been empty for at least - /// 2016 blocks as an additional protection against any bugs resulting in spuriously empty balance sets. + /// 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets. pub fn is_fully_resolved(&self, logger: &L) -> bool { let mut is_all_funds_claimed = self.get_claimable_balances().is_empty(); let current_height = self.current_best_block().height; @@ -1878,10 +1878,10 @@ impl ChannelMonitor { } } + const BLOCKS_THRESHOLD: u32 = 4032; // ~four weeks match (inner.balances_empty_height, is_all_funds_claimed) { (Some(balances_empty_height), true) => { // Claimed all funds, check if reached the blocks threshold. - const BLOCKS_THRESHOLD: u32 = 4032; // ~four weeks return current_height >= balances_empty_height + BLOCKS_THRESHOLD; }, (Some(_), false) => { @@ -1897,6 +1897,9 @@ impl ChannelMonitor { (None, true) => { // Claimed all funds but `balances_empty_height` is None. It is set to the // current block height. + log_debug!(logger, + "ChannelMonitor funded at {} is now fully resolved. It will become archivable in {} blocks", + inner.get_funding_txo().0, BLOCKS_THRESHOLD); inner.balances_empty_height = Some(current_height); false }, @@ -4381,6 +4384,7 @@ impl ChannelMonitorImpl { revocation_pubkey: broadcasted_holder_revokable_script.2, channel_keys_id: self.channel_keys_id, channel_value_satoshis: self.channel_value_satoshis, + channel_transaction_parameters: Some(self.onchain_tx_handler.channel_transaction_parameters.clone()), })); } }