fix divide by zero error

This commit is contained in:
Maxksim Fomenkov
2022-09-05 16:37:38 +03:00
parent 29657a64c3
commit cafd99cb84

View File

@@ -80,7 +80,7 @@ class EthereumBlockValidator : BlockValidator {
private fun validateDifficulty(node: JsonNode, rlpEncoded: Map<String, ByteArray>): Boolean {
val difficulty = fromHexStringI(node["difficulty"].asText())
if (difficulty.signum() < 0) {
if (difficulty.signum() <= 0) {
return false
}
val nonce = fromHexStringI(node["nonce"].asText())