From 595de3fccb595df46bbd263291ba5ec22f4dc7ab Mon Sep 17 00:00:00 2001 From: Lucas Molas Date: Thu, 30 Jul 2020 18:05:28 -0300 Subject: [PATCH] fix: block validator: check against heaviest tipset --- chain/sub/incoming.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index 31ca02baa..dfc8ddd71 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -336,12 +336,7 @@ func (bv *BlockValidator) checkPowerAndGetWorkerKey(ctx context.Context, bh *typ // we check that the miner met the minimum power at the lookback tipset - baseTs, err := bv.stmgr.ChainStore().LoadTipSet(types.NewTipSetKey(bh.Parents...)) - if err != nil { - log.Warnf("failed to load parent tipset of incoming block") - return address.Undef, err - } - + baseTs := bv.chain.GetHeaviestTipSet() lbts, err := stmgr.GetLookbackTipSetForRound(ctx, bv.stmgr, baseTs, bh.Height) if err != nil { log.Warnf("failed to load lookback tipset for incoming block")