diff --git a/nano/lib/numbers.cpp b/nano/lib/numbers.cpp index f33d6f3cb3..e8433be374 100644 --- a/nano/lib/numbers.cpp +++ b/nano/lib/numbers.cpp @@ -940,7 +940,11 @@ uint64_t nano::difficulty::from_multiplier (double const multiplier_a, uint64_t double nano::difficulty::to_multiplier (uint64_t const difficulty_a, uint64_t const base_difficulty_a) { - debug_assert (difficulty_a > 0); + if (difficulty_a == 0) + { + return 1.0; + } + return static_cast (-base_difficulty_a) / (-difficulty_a); }