diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumBlockValidator.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumBlockValidator.kt index 25a84293..3fc2ea84 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumBlockValidator.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumBlockValidator.kt @@ -174,7 +174,7 @@ class EthereumBlockValidator : BlockValidator { private fun BigInteger.asUint64() = this.toByteArray().let { bytes -> ByteArray(8) { val index = bytes.size - it - 1 - if (index < bytes.size) bytes[index] else 0 + if (index < bytes.size && index >= 0) bytes[index] else 0 } }