Skip to content

Commit b884bf3

Browse files
author
Aurélien Richez
committed
check the number when using getHashByBlockNumber
1 parent ef2a6de commit b884bf3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/scala/io/iohk/ethereum/domain/branch/BestBlockchainBranch.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ class BestBlockchainBranch(
3030
} else None
3131

3232
override def getHashByBlockNumber(number: BigInt): Option[ByteString] =
33-
bestChainBlockNumberMappingStorage.get(number)
33+
if (tipBlockHeader.number >= number && number >= 0) {
34+
bestChainBlockNumberMappingStorage.get(number)
35+
} else None
3436
}

0 commit comments

Comments
 (0)