From 485f13de1254ad1ef833ab4ebe663bd4f972e9cc Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 2 Sep 2020 16:45:23 -0400 Subject: [PATCH] Remove load check --- chain/store/store.go | 11 +++++------ chain/sync.go | 10 ++++------ 2 files changed, 9 insertions(+), 12 deletions(-) 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")