Skip to content
Merged
Prev Previous commit
Next Next commit
add comment
  • Loading branch information
tzdybal committed Oct 11, 2021
commit 7f61c8f26274adf5de2f69b3667bd5bcd62943fd
3 changes: 3 additions & 0 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ func (m *Manager) SyncLoop(ctx context.Context) {
m.logger.Debug("block header received", "height", header.Height, "hash", header.Hash())
newHeight := header.Height
currentHeight := m.store.Height()
// in case of client reconnecting after being offline
// newHeight may be significantly larger than currentHeight
// it's handled gently in RetrieveLoop
if newHeight > currentHeight {
atomic.StoreUint64(&m.syncTarget, newHeight)
m.retrieveCh <- newHeight
Expand Down