UNPKG

leap-node

Version:

[![codecov](https://codecov.io/gh/leapdao/leap-node/branch/master/graph/badge.svg)](https://codecov.io/gh/leapdao/leap-node) [![Docker Repository on Quay](https://quay.io/repository/leapdao/leap-node/status "Docker Repository on Quay")](https://quay.io/re

8 lines (7 loc) 275 B
module.exports = ({ epoch }, chainInfo) => { const heightFromLastEpoch = chainInfo.height - epoch.lastEpochHeight; if (epoch.epochLength && heightFromLastEpoch >= epoch.epochLength * 32) { epoch.lastEpochHeight += epoch.epochLength * 32; epoch.epoch += 1; } };