Skip to content

Commit

Permalink
Merge pull request #2817 from tnull/2024-01-time-in-electrum
Browse files Browse the repository at this point in the history
Feature-gate `time` use also in `ElectrumSyncClient`
  • Loading branch information
TheBlueMatt authored Jan 9, 2024
2 parents 78ac48c + 2bd1213 commit 0d513fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lightning-transaction-sync/src/electrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ where
let mut sync_state = self.sync_state.lock().unwrap();

log_trace!(self.logger, "Starting transaction sync.");
#[cfg(feature = "time")]
let start_time = Instant::now();
let mut num_confirmed = 0;
let mut num_unconfirmed = 0;
Expand Down Expand Up @@ -210,10 +211,15 @@ where
sync_state.pending_sync = false;
}
}
#[cfg(feature = "time")]
log_debug!(self.logger,
"Finished transaction sync at tip {} in {}ms: {} confirmed, {} unconfirmed.",
tip_header.block_hash(), start_time.elapsed().as_millis(), num_confirmed,
num_unconfirmed);
#[cfg(not(feature = "time"))]
log_debug!(self.logger,
"Finished transaction sync at tip {}: {} confirmed, {} unconfirmed.",
tip_header.block_hash(), num_confirmed, num_unconfirmed);
Ok(())
}

Expand Down

0 comments on commit 0d513fd

Please sign in to comment.