use of tech.pegasys.teku.spec.datastructures.forkchoice.ReadOnlyStore in project teku by ConsenSys.
the class BlockValidator method blockIsFromFutureSlot.
private boolean blockIsFromFutureSlot(SignedBeaconBlock block) {
ReadOnlyStore store = recentChainData.getStore();
final long disparityInSeconds = Math.round((float) MAXIMUM_GOSSIP_CLOCK_DISPARITY / 1000.0);
final UInt64 maxOffset = UInt64.valueOf(disparityInSeconds);
final UInt64 maxTime = store.getTime().plus(maxOffset);
UInt64 maxCurrSlot = spec.getCurrentSlot(maxTime, store.getGenesisTime());
return block.getSlot().compareTo(maxCurrSlot) > 0;
}
Aggregations