Skip to content

Commit 1ab30ce

Browse files
authored
Fixes a bug that caused miners to assume new epoch one block too early (#941)
1 parent 2a7af2e commit 1ab30ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/io/iohk/ethereum/consensus/ethash/EthashMiner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class EthashMiner(
6262
.getBlockForMining(blockValue)
6363
.map {
6464
case PendingBlockAndState(PendingBlock(block, _), _) => {
65-
val blockNumber = block.header.number.toLong + 1
65+
val blockNumber = block.header.number.toLong
6666
val epoch = EthashUtils.epoch(blockNumber, blockCreator.blockchainConfig.ecip1099BlockNumber.toLong)
6767
val (dag, dagSize) = calculateDagSize(blockNumber, epoch)
6868
val headerHash = crypto.kec256(BlockHeader.getEncodedWithoutNonce(block.header))

0 commit comments

Comments
 (0)