Skip to content

Commit

Permalink
fix: listing mode is synced (#5830)
Browse files Browse the repository at this point in the history
Description
---
Fixes the listening mode is_synced flag

Motivation and Context
---
The is synced flag should only be set if the node is actually up to
date. This was the case, but recent updates changed this.
  • Loading branch information
SWvheerden authored Oct 5, 2023
1 parent dd2eddb commit ff5a5d8
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,7 @@ impl Listening {
return StateEvent::FallenBehind(sync_mode);
}

// if the mode is SyncNotPossible, we know of peers that have a higher pow than us, but we cannot
// sync from them due to their pruning mode settings as they cannot supply us with the required full
// blocks we require, so we should not enter sync and await better peers who can provide us this
if !self.is_synced && !sync_mode.is_sync_not_possible() {
if !self.is_synced && sync_mode.is_up_to_date() {
self.is_synced = true;
shared.set_state_info(StateInfo::Listening(ListeningInfo::new(true)));
debug!(target: LOG_TARGET, "Initial sync achieved");
Expand Down

0 comments on commit ff5a5d8

Please sign in to comment.