Skip to content

Commit

Permalink
Merge pull request #708 from evoskuil/master
Browse files Browse the repository at this point in the history
Use link vs. height with set_prevouts() stub, add neutrino to confirm.
  • Loading branch information
evoskuil authored Jan 8, 2025
2 parents a84e314 + 498542f commit 37f728f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void chaser_confirm::do_validated(height_t height) NOEXCEPT
do_bump(height);
}

// TODO: This is a simplified variant of the full implementation below.
// TODO: This is simplified single thread variant of full implementation below.
// This variant doesn't implement the relative work check and instead confirms
// one block at a time, just like validation.
void chaser_confirm::do_bump(height_t) NOEXCEPT
Expand Down Expand Up @@ -208,9 +208,10 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
return;
}

/////////////////////////////////////////
//////////////////////////////////////////
// Confirmation query.
/////////////////////////////////////////
// This will pull from new prevouts table.
//////////////////////////////////////////
if ((ec = query.block_confirmable(link)))
{
if (ec == database::error::integrity)
Expand Down Expand Up @@ -283,7 +284,12 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
return;
}

update_neutrino(link);
if (!update_neutrino(link))
{
fault(error::confirm10);
return;
}

set_position(height);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void chaser_validate::validate_block(const header_link& link) NOEXCEPT
{
ec = error::validate5;
}
else if (!query.set_prevouts(ctx.height, *block))
else if (!query.set_prevouts(link, *block))
{
ec = error::validate6;
}
Expand Down

0 comments on commit 37f728f

Please sign in to comment.