Skip to content

Commit

Permalink
feat(collator): use of gen utime in comparison with next anchor time
Browse files Browse the repository at this point in the history
  • Loading branch information
serejkaaa512 authored and SmaGMan committed Jul 8, 2024
1 parent 8ce6dcf commit 2d43e73
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions collator/src/collator/do_collate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,11 +844,9 @@ impl CollatorStdImpl {

let anchor = &entry.1.anchor;
let expire_timeout = 60 * 1000; // 1 minute
let now = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.expect("current time since unix epoch")
.as_millis() as u64;
if now - anchor.chain_time() > expire_timeout {
let next_chain_time =
collation_data.gen_utime as u64 * 1000 + collation_data.gen_utime_ms as u64;
if next_chain_time - anchor.chain_time() > expire_timeout {
let iter = anchor.externals_iterator(0);
for ext_msg in iter {
tracing::info!(target: tracing_targets::COLLATOR_READ_NEXT_EXTS,
Expand Down

0 comments on commit 2d43e73

Please sign in to comment.