Merge pull request #2719 from filecoin-project/schoamtis/fix/incoming/check-against-heaviest
fix: block validator: check against heaviest tipset
This commit is contained in:
commit
a4e30a851b
@ -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
|
// we check that the miner met the minimum power at the lookback tipset
|
||||||
|
|
||||||
baseTs, err := bv.stmgr.ChainStore().LoadTipSet(types.NewTipSetKey(bh.Parents...))
|
baseTs := bv.chain.GetHeaviestTipSet()
|
||||||
if err != nil {
|
|
||||||
log.Warnf("failed to load parent tipset of incoming block")
|
|
||||||
return address.Undef, err
|
|
||||||
}
|
|
||||||
|
|
||||||
lbts, err := stmgr.GetLookbackTipSetForRound(ctx, bv.stmgr, baseTs, bh.Height)
|
lbts, err := stmgr.GetLookbackTipSetForRound(ctx, bv.stmgr, baseTs, bh.Height)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("failed to load lookback tipset for incoming block")
|
log.Warnf("failed to load lookback tipset for incoming block")
|
||||||
|
Loading…
Reference in New Issue
Block a user