forked from lthn/blockchain
a rare case in get_est_height_from_date fixed (credits go to @crypto_zoidberg)
This commit is contained in:
parent
0fcfe2e540
commit
1a698a72b2
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue