From 2b83089da86522b24bfd99609d5729a0a342c5aa Mon Sep 17 00:00:00 2001 From: Mike Greenberg Date: Mon, 31 Aug 2020 22:55:11 -0400 Subject: [PATCH] fix(chainwatch): Add important documentation --- cmd/lotus-chainwatch/syncer/sync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/lotus-chainwatch/syncer/sync.go b/cmd/lotus-chainwatch/syncer/sync.go index 9688a5f8a..52a36fc9e 100644 --- a/cmd/lotus-chainwatch/syncer/sync.go +++ b/cmd/lotus-chainwatch/syncer/sync.go @@ -186,6 +186,10 @@ func (s *Syncer) Start(ctx context.Context) { for _, change := range notif { switch change.Type { case store.HCCurrent: + // This case is important for capturing the initial state of a node + // which might be on a dead network with no new blocks being produced. + // It also allows a fresh Chainwatch instance to start walking the + // chain without waiting for a new block to come along. fallthrough case store.HCApply: unsynced, err := s.unsyncedBlocks(ctx, change.Val, sinceEpoch)