Merge pull request #9 from p2p-org/fix_divide_by_zero_error
WIP: fix divide by zero error
This commit is contained in:
@@ -80,7 +80,7 @@ class EthereumBlockValidator : BlockValidator {
|
|||||||
|
|
||||||
private fun validateDifficulty(node: JsonNode, rlpEncoded: Map<String, ByteArray>): Boolean {
|
private fun validateDifficulty(node: JsonNode, rlpEncoded: Map<String, ByteArray>): Boolean {
|
||||||
val difficulty = fromHexStringI(node["difficulty"].asText())
|
val difficulty = fromHexStringI(node["difficulty"].asText())
|
||||||
if (difficulty.signum() < 0) {
|
if (difficulty.compareTo(BigInteger.ZERO) == 0 || difficulty.signum() < 0) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
val nonce = fromHexStringI(node["nonce"].asText())
|
val nonce = fromHexStringI(node["nonce"].asText())
|
||||||
|
|||||||
Reference in New Issue
Block a user