Skip to content

Commit 64c98c4

Browse files
committed
Don't call system time in no-std
1 parent 4deb263 commit 64c98c4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lightning-transaction-sync/src/esplora.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use esplora_client::r#async::AsyncClient;
1414
#[cfg(not(feature = "async-interface"))]
1515
use esplora_client::blocking::BlockingClient;
1616

17-
use std::time::Instant;
1817
use std::collections::HashSet;
1918
use core::ops::Deref;
2019

@@ -91,7 +90,8 @@ where
9190
let mut sync_state = self.sync_state.lock().await;
9291

9392
log_trace!(self.logger, "Starting transaction sync.");
94-
let start_time = Instant::now();
93+
#[cfg(feature = "std")]
94+
let start_time = std::time::Instant::now();
9595
let mut num_confirmed = 0;
9696
let mut num_unconfirmed = 0;
9797

@@ -227,8 +227,12 @@ where
227227
sync_state.pending_sync = false;
228228
}
229229
}
230+
#[cfg(feature = "std")]
230231
log_debug!(self.logger, "Finished transaction sync at tip {} in {}ms: {} confirmed, {} unconfirmed.",
231232
tip_hash, start_time.elapsed().as_millis(), num_confirmed, num_unconfirmed);
233+
#[cfg(not(feature = "std"))]
234+
log_debug!(self.logger, "Finished transaction sync at tip {}: {} confirmed, {} unconfirmed.",
235+
tip_hash, num_confirmed, num_unconfirmed);
232236
Ok(())
233237
}
234238

0 commit comments

Comments
 (0)