fix: Prevent u64 timestamp wrap-around in LocalMiner (#18791)

This commit is contained in:
viktorking7
2025-09-30 17:29:14 +02:00
committed by GitHub
parent 530e62d0e9
commit 0694abcee8

View File

@@ -194,7 +194,7 @@ where
/// through newPayload.
async fn advance(&mut self) -> eyre::Result<()> {
let timestamp = std::cmp::max(
self.last_timestamp + 1,
self.last_timestamp.saturating_add(1),
std::time::SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("cannot be earlier than UNIX_EPOCH")