Skip to content

Commit

Permalink
f rewrite text
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Jul 9, 2022
1 parent 5ceeb27 commit 33cebe0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lightning/src/routing/scoring.rs
Expand Up @@ -1178,10 +1178,10 @@ impl<T: Time> Readable for ChannelLiquidity<T> {
(4, duration_since_epoch, required),
});
// On rust prior to 1.60 `Instant::duration_since` will panic if time goes backwards.
// Because we calculate "now" against wallclock time when we were written are reloading
// here, we may cause time to go backwards if wallclock time is before when we were
// written. Thus, we check if we'd end up with a time in the future and just use `now`
// instead to avoid panicing later.
// Because we write `last_updated` as wallclock time when we were written and create an
// `Instant` which represents that wallclock time, we may hit that panic if wallclock time
// is before when we were written. Thus, we check if we'd end up with a time in the future
// and just use `now` instead to avoid panicing later.
let wall_clock_now = T::duration_since_epoch();
let now = T::now();
let last_updated = if wall_clock_now > duration_since_epoch {
Expand Down

0 comments on commit 33cebe0

Please sign in to comment.