Skip to content

Commit

Permalink
Add set_organized to confirmation.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jan 5, 2025
1 parent 7baf31b commit 557ee45
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
fault(error::confirm2);
return;
}


/////////////////////////////////////////
// Confirmation query.
/////////////////////////////////////////
if ((ec = query.block_confirmable(link)))
{
if (ec == database::error::integrity)
Expand Down Expand Up @@ -243,6 +245,12 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
fault(error::confirm6);
return;
}

if (!set_organized(link, height))
{
fault(error::confirm7);
return;
}

notify(error::success, chase::confirmable, height);
fire(events::block_confirmed, height);
Expand All @@ -253,7 +261,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
{
if (!query.set_strong(link))
{
fault(error::confirm7);
fault(error::confirm8);
return;
}

Expand All @@ -271,7 +279,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
// database::error::unknown_state [shouldn't be here]
// database::error::unassociated [shouldn't be here]
// database::error::unvalidated [shouldn't be here]
fault(error::confirm8);
fault(error::confirm9);
return;
}

Expand All @@ -286,7 +294,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
// first) here. Candidate chain reorganizations will result in reported heights
// moving in any direction. Each is treated as independent and only one
// representing a stronger chain is considered.

////
////// Compute relative work, set fork and fork_point, and invoke reorganize.
////void chaser_confirm::do_validated(height_t height) NOEXCEPT
////{
Expand Down

0 comments on commit 557ee45

Please sign in to comment.