From cfadfbd91a5c2c00213e922ed174a17c8fe8de6a Mon Sep 17 00:00:00 2001 From: wowario Date: Wed, 14 Apr 2021 11:49:18 +0000 Subject: [PATCH] hotfix --- src/cryptonote_basic/difficulty.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_basic/difficulty.cpp b/src/cryptonote_basic/difficulty.cpp index 76d182369..c08484ec8 100644 --- a/src/cryptonote_basic/difficulty.cpp +++ b/src/cryptonote_basic/difficulty.cpp @@ -389,7 +389,7 @@ namespace cryptonote { avg_D = static_cast(( cumulative_difficulties[N] - cumulative_difficulties[0] )/ N); // Prevent round off error for small D and overflow for large D. - if (avg_D > 2000000*N*N*T) { + if (avg_D > uint64_t(-1)/(N*(N+1)*T*99)) { next_D = (avg_D/(200*L))*(N*(N+1)*T*99); } else { next_D = (avg_D*N*(N+1)*T*99)/(200*L); }