fix: block validator: check against heaviest tipset

This commit is contained in:
Lucas Molas 2020-07-30 18:05:28 -03:00
parent c762770031
commit 595de3fccb

View File

@ -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")