Remove unnecessary database reads in validation check
This commit is contained in:
parent
dc6392db49
commit
3228ae5672
@ -1791,11 +1791,10 @@ func (syncer *Syncer) getLatestBeaconEntry(_ context.Context, ts *types.TipSet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (syncer *Syncer) IsEpochBeyondCurrMax(epoch abi.ChainEpoch) bool {
|
func (syncer *Syncer) IsEpochBeyondCurrMax(epoch abi.ChainEpoch) bool {
|
||||||
g, err := syncer.store.GetGenesis()
|
if syncer.Genesis == nil {
|
||||||
if err != nil {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
now := uint64(build.Clock.Now().Unix())
|
now := uint64(build.Clock.Now().Unix())
|
||||||
return epoch > (abi.ChainEpoch((now-g.Timestamp)/build.BlockDelaySecs) + MaxHeightDrift)
|
return epoch > (abi.ChainEpoch((now-syncer.Genesis.MinTimestamp())/build.BlockDelaySecs) + MaxHeightDrift)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user