Skip to content

Commit 9125de2

Browse files
committed
Opportunistically skip log in update_claims_view_from_requests
On each block, for each `ChannelMonitor`, we log a status statement in `OnChainTx::update_claims_view_from_requests`. This can add up to quite a bit, and is generally not very interesting when we don't actually do anything if there's no claims to bump. Here we drop the log if we have no claims to work with, but retain it if we process any claims.
1 parent aab5b10 commit 9125de2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lightning/src/chain/onchaintx.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,10 @@ impl<ChannelSigner: WriteableEcdsaChannelSigner> OnchainTxHandler<ChannelSigner>
726726
B::Target: BroadcasterInterface,
727727
F::Target: FeeEstimator,
728728
{
729-
log_debug!(logger, "Updating claims view at height {} with {} claim requests", cur_height, requests.len());
729+
if !requests.is_empty() {
730+
log_debug!(logger, "Updating claims view at height {} with {} claim requests", cur_height, requests.len());
731+
}
732+
730733
let mut preprocessed_requests = Vec::with_capacity(requests.len());
731734
let mut aggregated_request = None;
732735

@@ -772,6 +775,12 @@ impl<ChannelSigner: WriteableEcdsaChannelSigner> OnchainTxHandler<ChannelSigner>
772775

773776
// Claim everything up to and including `cur_height`
774777
let remaining_locked_packages = self.locktimed_packages.split_off(&(cur_height + 1));
778+
if !self.locktimed_packages.is_empty() {
779+
log_debug!(logger,
780+
"Updating claims view at height {} with {} locked packages available for claim",
781+
cur_height,
782+
self.locktimed_packages.len());
783+
}
775784
for (pop_height, mut entry) in self.locktimed_packages.iter_mut() {
776785
log_trace!(logger, "Restoring delayed claim of package(s) at their timelock at {}.", pop_height);
777786
preprocessed_requests.append(&mut entry);

0 commit comments

Comments
 (0)