From 1a698a72b23d0ed174aa01c1f5dc16a2c5c93537 Mon Sep 17 00:00:00 2001 From: sowle Date: Fri, 28 Apr 2023 21:51:28 +0200 Subject: [PATCH] a rare case in get_est_height_from_date fixed (credits go to @crypto_zoidberg) --- src/currency_core/blockchain_storage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index e601b888..d6defdf4 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -3264,7 +3264,7 @@ bool blockchain_storage::get_est_height_from_date(uint64_t date, uint64_t& res_h //we moved too much forward current_height_boundary = calculated_estimated_height; - CHECK_AND_ASSERT_MES(current_height_boundary > current_low_boundary, true, + CHECK_AND_ASSERT_MES(current_height_boundary >= current_low_boundary, true, "Internal error: current_hight_boundary(" << current_height_boundary << ") > current_low_boundary("<< current_low_boundary << ")"); uint64_t offset = (current_height_boundary - current_low_boundary)/2; if (offset <= 2) @@ -3282,7 +3282,7 @@ bool blockchain_storage::get_est_height_from_date(uint64_t date, uint64_t& res_h { //we too much in past current_low_boundary = calculated_estimated_height; - CHECK_AND_ASSERT_MES(current_height_boundary > current_low_boundary, true, + CHECK_AND_ASSERT_MES(current_height_boundary >= current_low_boundary, true, "Internal error: current_hight_boundary(" << current_height_boundary << ") > current_low_boundary(" << current_low_boundary << ")"); uint64_t offset = (current_height_boundary - current_low_boundary) / 2; if (offset <= 2)