diff --git a/chain/store/store.go b/chain/store/store.go index 0d38ba9b5..b64277302 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -1278,13 +1278,12 @@ func (cs *ChainStore) GetLatestBeaconEntry(ts *types.TipSet) (*types.BeaconEntry return nil, xerrors.Errorf("made it back to genesis block without finding beacon entry") } - if i != 19 { - next, err := cs.LoadTipSet(cur.Parents()) - if err != nil { - return nil, xerrors.Errorf("failed to load parents when searching back for latest beacon entry: %w", err) - } - cur = next + next, err := cs.LoadTipSet(cur.Parents()) + if err != nil { + return nil, xerrors.Errorf("failed to load parents when searching back for latest beacon entry: %w", err) } + cur = next + } if os.Getenv("LOTUS_IGNORE_DRAND") == "_yes_" { diff --git a/chain/sync.go b/chain/sync.go index 3e2bf9a0f..775c32843 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -1630,13 +1630,11 @@ func (syncer *Syncer) getLatestBeaconEntry(_ context.Context, ts *types.TipSet) return nil, xerrors.Errorf("made it back to genesis block without finding beacon entry") } - if i != 19 { - next, err := syncer.store.LoadTipSet(cur.Parents()) - if err != nil { - return nil, xerrors.Errorf("failed to load parents when searching back for latest beacon entry: %w", err) - } - cur = next + next, err := syncer.store.LoadTipSet(cur.Parents()) + if err != nil { + return nil, xerrors.Errorf("failed to load parents when searching back for latest beacon entry: %w", err) } + cur = next } return nil, xerrors.Errorf("found NO beacon entries in the 20 latest tipsets")