Skip to content

Commit

Permalink
Adding unwrap_or around time to not fail when time goes back on the l…
Browse files Browse the repository at this point in the history
…aptop
  • Loading branch information
ilblackdragon committed Sep 9, 2020
1 parent ddac296 commit 01045f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chain/client/src/client_actor.rs
Expand Up @@ -744,7 +744,7 @@ impl ClientActor {
);
delay = core::cmp::min(
delay,
self.doomslug_timer_next_attempt.signed_duration_since(now).to_std().unwrap(),
self.doomslug_timer_next_attempt.signed_duration_since(now).to_std().unwrap_or(delay),
)
}
if self.block_production_started {
Expand All @@ -761,7 +761,7 @@ impl ClientActor {

delay = core::cmp::min(
delay,
self.block_production_next_attempt.signed_duration_since(now).to_std().unwrap(),
self.block_production_next_attempt.signed_duration_since(now).to_std().unwrap_or(delay),
)
}
self.chunk_request_retry_next_attempt = self.run_timer(
Expand All @@ -772,7 +772,7 @@ impl ClientActor {
);
core::cmp::min(
delay,
self.chunk_request_retry_next_attempt.signed_duration_since(now).to_std().unwrap(),
self.chunk_request_retry_next_attempt.signed_duration_since(now).to_std().unwrap_or(delay),
)
}

Expand Down
2 changes: 2 additions & 0 deletions deny.toml
Expand Up @@ -51,6 +51,8 @@ skip = [
{ name = "syn", version = "=0.15.44" },
{ name = "static_assertions", version = "=0.2.5" },
{ name = "parking_lot", version = "=0.7.1" },
{ name = "parking_lot_core", version = "=0.4.0" },
{ name = "lock_api", version = "=0.1.5" },
{ name = "smallvec", version = "=0.6.13" },
{ name = "scopeguard", version = "=0.3.3" },
{ name = "rustc-hex", version = "=1.0.0" },
Expand Down

0 comments on commit 01045f2

Please sign in to comment.