File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2418,6 +2418,7 @@ func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error) {
24182418 start := time .Now ().UTC ()
24192419 vi := common .GetVersionInfo ()
24202420 inSync , bestHeight , lastBlockTime , startSync := w .is .GetSyncState ()
2421+ blockPeriod := w .is .GetAvgBlockPeriod ()
24212422 if ! inSync && ! w .is .InitialSync {
24222423 // if less than 5 seconds into syncing, return inSync=true to avoid short time not in sync reports that confuse monitoring
24232424 if startSync .Add (5 * time .Second ).After (start ) {
@@ -2435,6 +2436,13 @@ func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error) {
24352436 inSync = false
24362437 inSyncMempool = false
24372438 }
2439+ // for networks with stable block period, set not in sync if last sync more than 12 block periods ago
2440+ if inSync && blockPeriod > 0 && w .chainType == bchain .ChainEthereumType {
2441+ threshold := 12 * time .Duration (blockPeriod ) * time .Second
2442+ if lastBlockTime .Add (threshold ).Before (time .Now ().UTC ()) {
2443+ inSync = false
2444+ }
2445+ }
24382446 var columnStats []common.InternalStateColumn
24392447 var internalDBSize int64
24402448 if internal {
You can’t perform that action at this time.
0 commit comments