Skip to content

Commit

Permalink
Merge pull request #18 from RealAstolfo/realastolfo-time-overflow-fix
Browse files Browse the repository at this point in the history
added fix for Instant::now() subtraction overflow
  • Loading branch information
Nuhvi authored Jun 24, 2024
2 parents 71c773e + b9b4926 commit d5e9804
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Rpc {
put_queries: HashMap::new(),
closest_nodes: LruCache::new(NonZeroUsize::new(MAX_CACHED_BUCKETS).unwrap()),

last_table_refresh: Instant::now() - REFRESH_TABLE_INTERVAL,
last_table_refresh: Instant::now().checked_sub(REFRESH_TABLE_INTERVAL).unwrap_or_else(Instant::now),
last_table_ping: Instant::now(),
})
}
Expand Down

0 comments on commit d5e9804

Please sign in to comment.