Skip to content

Commit

Permalink
Enable confirmation when validation is current.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jun 18, 2024
1 parent 3561feb commit 894ef6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ bool chaser_confirm::handle_event(const code&, chase event_,
POST(do_validated, possible_narrow_cast<height_t>(value));
break;
}
////case chase::valid:
////{
//// // value is individual height.
//// POST(do_validated, possible_narrow_cast<height_t>(value));
//// break;
////}
case chase::valid:
{
// value is individual height.
POST(do_validated, possible_narrow_cast<height_t>(value));
break;
}
case chase::stop:
{
return false;
Expand Down
14 changes: 4 additions & 10 deletions src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,22 +167,15 @@ void chaser_validate::do_bump(height_t) NOEXCEPT
return;
}

// TODO: validation currency hack, move to base.
uint32_t time{};
if (!query.get_timestamp(time, link))
{
fault(error::set_block_valid);
return;
}

if ((ec == database::error::block_valid) ||
(ec == database::error::block_confirmable) ||
is_under_checkpoint(height) || query.is_milestone(link))
{
update_position(height);
////fire(events::validate_bypassed, height);

if (is_current(time))
// Don't confirm until validations are current.
if (is_current(link))
notify(ec, chase::valid, height);

continue;
Expand All @@ -205,7 +198,8 @@ void chaser_validate::do_bump(height_t) NOEXCEPT
update_position(height);
fire(events::block_validated, height);

if (is_current(time))
// Don't confirm until validations are current.
if (is_current(link))
notify(ec, chase::valid, height);
}
}
Expand Down

0 comments on commit 894ef6f

Please sign in to comment.