Skip to content

Commit

Permalink
fix test and reset if we get up to date in the background
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Aug 31, 2023
1 parent f909905 commit d5b45e1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ impl Listening {
sync_peers: sync_peers.clone(),
});
}
} else {
// We might have gotten up to date via propagation outside of this state, so reset the timer
if sync_mode == SyncStatus::UpToDate {
time_since_better_block = None;
}
}

if sync_mode.is_lagging() {
Expand Down Expand Up @@ -390,6 +395,6 @@ mod test {
assert!(sync_mode.is_lagging());

let sync_mode = determine_sync_mode(2, behind_node.claimed_chain_metadata(), &archival_node);
assert!(sync_mode.is_up_to_date());
assert!(matches!(sync_mode, SyncStatus::BehindButNotYetLagging { .. }));
}
}

0 comments on commit d5b45e1

Please sign in to comment.