Skip to content

Commit fd0c3e4

Browse files
committed
Log when a ChannelMonitor's claimable balances set goes empty
1 parent 71fef35 commit fd0c3e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)