1
0
Fork 0
forked from lthn/blockchain

a rare case in get_est_height_from_date fixed (credits go to @crypto_zoidberg)

This commit is contained in:
sowle 2023-04-28 21:51:28 +02:00
parent 0fcfe2e540
commit 1a698a72b2
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -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)