mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-20 02:08:12 +00:00
Fix condition. (#1734)
This commit is contained in:
parent
1f5b487fc6
commit
2cd0c3adaa
@ -751,16 +751,17 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A) {.async.} =
|
|||||||
man.notInSyncEvent.clear()
|
man.notInSyncEvent.clear()
|
||||||
return
|
return
|
||||||
|
|
||||||
if peerAge <= man.maxHeadAge:
|
if headSlot >= peerSlot - man.maxHeadAge:
|
||||||
debug "We are in sync with peer, refreshing peer's status information",
|
debug "We are in sync with peer, refreshing peer's status information",
|
||||||
wall_clock_slot = wallSlot, remote_head_slot = peerSlot,
|
wall_clock_slot = wallSlot, remote_head_slot = peerSlot,
|
||||||
local_head_slot = headSlot, peer = peer, peer_score = peer.getScore(),
|
local_head_slot = headSlot, peer = peer, peer_score = peer.getScore(),
|
||||||
index = index, peer_speed = peer.netKbps(), topics = "syncman"
|
index = index, peer_speed = peer.netKbps(), topics = "syncman"
|
||||||
|
|
||||||
|
man.workers[index].status = SyncWorkerStatus.UpdatingStatus
|
||||||
|
|
||||||
if peerStatusAge <= StatusUpdateInterval:
|
if peerStatusAge <= StatusUpdateInterval:
|
||||||
await sleepAsync(StatusUpdateInterval - peerStatusAge)
|
await sleepAsync(StatusUpdateInterval - peerStatusAge)
|
||||||
|
|
||||||
man.workers[index].status = SyncWorkerStatus.UpdatingStatus
|
|
||||||
try:
|
try:
|
||||||
let res = await peer.updateStatus()
|
let res = await peer.updateStatus()
|
||||||
if not(res):
|
if not(res):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user