Skip to content

Commit 2bd1213

Browse files
committed
Feature-gate time use also in ElectrumSyncClient
A previous commit introduced the `time` feature to gate the use of `SystemTime` dependent APIs in `EsploraSyncClient`. It however omitted doing the same for the Electrum side of things. Here, we address this oversight.
1 parent 78ac48c commit 2bd1213

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning-transaction-sync/src/electrum.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ where
8686
let mut sync_state = self.sync_state.lock().unwrap();
8787

8888
log_trace!(self.logger, "Starting transaction sync.");
89+
#[cfg(feature = "time")]
8990
let start_time = Instant::now();
9091
let mut num_confirmed = 0;
9192
let mut num_unconfirmed = 0;
@@ -210,10 +211,15 @@ where
210211
sync_state.pending_sync = false;
211212
}
212213
}
214+
#[cfg(feature = "time")]
213215
log_debug!(self.logger,
214216
"Finished transaction sync at tip {} in {}ms: {} confirmed, {} unconfirmed.",
215217
tip_header.block_hash(), start_time.elapsed().as_millis(), num_confirmed,
216218
num_unconfirmed);
219+
#[cfg(not(feature = "time"))]
220+
log_debug!(self.logger,
221+
"Finished transaction sync at tip {}: {} confirmed, {} unconfirmed.",
222+
tip_header.block_hash(), num_confirmed, num_unconfirmed);
217223
Ok(())
218224
}
219225

0 commit comments

Comments
 (0)