From 21d729b69fa347a2293d32c6522e4afe8dc0adcd Mon Sep 17 00:00:00 2001 From: startyourday60 <116428444+startyourday60@users.noreply.github.com> Date: Thu, 5 Jan 2023 06:41:20 +0300 Subject: [PATCH] Divide by zero fix --- src/server/shared/Gostcoin/Gostcoin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/shared/Gostcoin/Gostcoin.h b/src/server/shared/Gostcoin/Gostcoin.h index 7b187e2..1cf0e4f 100644 --- a/src/server/shared/Gostcoin/Gostcoin.h +++ b/src/server/shared/Gostcoin/Gostcoin.h @@ -13,6 +13,7 @@ namespace Gostcoin inline BigInt TargetToDiff(BigInt val) { static BigInt c("0x00000000ffff0000000000000000000000000000000000000000000000000000"); + if (val == 0) return c; return (c / val); }