From cafd99cb84c2e384b5633848316e993d21b3a78d Mon Sep 17 00:00:00 2001 From: Maxksim Fomenkov Date: Mon, 5 Sep 2022 16:37:38 +0300 Subject: [PATCH] fix divide by zero error --- .../dshackle/upstream/ethereum/EthereumBlockValidator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3fc2ea84..54a9413b 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumBlockValidator.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumBlockValidator.kt @@ -80,7 +80,7 @@ class EthereumBlockValidator : BlockValidator { private fun validateDifficulty(node: JsonNode, rlpEncoded: Map): Boolean { val difficulty = fromHexStringI(node["difficulty"].asText()) - if (difficulty.signum() < 0) { + if (difficulty.signum() <= 0) { return false } val nonce = fromHexStringI(node["nonce"].asText())