Skip to content

Commit

Permalink
Merge pull request #703 from evoskuil/master
Browse files Browse the repository at this point in the history
Rename to_tx_spends due to db change.
  • Loading branch information
evoskuil authored Jan 2, 2025
2 parents d0e4cd2 + 2c50aaa commit 2483d0a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion console/executor_scans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void executor::scan_collisions() const
const auto transactions = query_.to_transactions(link);
for (const auto& transaction: transactions)
{
const auto inputs = query_.to_tx_spends(transaction);
const auto inputs = query_.to_spends(transaction);
for (const auto& in: inputs)
{
++total;
Expand Down
1 change: 0 additions & 1 deletion src/chasers/chaser_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ size_t chaser_check::set_unassociated() NOEXCEPT
<< count << ") last ("
<< requested_ << ").");

////notify(error::success, chase::checking, requested_);
return count;
}

Expand Down
21 changes: 7 additions & 14 deletions src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ chaser_confirm::chaser_confirm(full_node& node) NOEXCEPT
: chaser(node),
concurrent_(node.config().node.concurrent_confirmation),
threadpool_(1_u32, node.config().node.priority_validation ?
network::thread_priority::highest : network::thread_priority::high),
network::thread_priority::high : network::thread_priority::normal),
strand_(threadpool_.service().get_executor())
{
}
Expand Down Expand Up @@ -86,7 +86,7 @@ bool chaser_confirm::handle_event(const code&, chase event_,
return true;

// An unconfirmable block height must not land here.
// These can come out of order, advance in order synchronously.
// These come out of order, advance in order synchronously.
switch (event_)
{
////case chase::blocks:
Expand Down Expand Up @@ -127,14 +127,6 @@ bool chaser_confirm::handle_event(const code&, chase event_,

break;
}
////case chase::checking:
////{
//// BC_ASSERT(std::holds_alternative<height_t>(value));
//// ////POST(do_checking, std::get<height_t>(value));
//// boost::asio::post(strand_,
//// BIND(do_checking, std::get<height_t>(value)));
//// break;
////}
case chase::regressed:
{
BC_ASSERT(std::holds_alternative<height_t>(value));
Expand Down Expand Up @@ -164,10 +156,6 @@ bool chaser_confirm::handle_event(const code&, chase event_,
return true;
}

////void chaser_confirm::do_checking(height_t height) NOEXCEPT
////{
////}

void chaser_confirm::do_regressed(height_t branch_point) NOEXCEPT
{
BC_ASSERT(stranded());
Expand All @@ -194,6 +182,9 @@ void chaser_confirm::do_validated(height_t height) NOEXCEPT
do_bump(height);
}

// TODO: This is a simplified variant of the 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
{
BC_ASSERT(stranded());
Expand Down Expand Up @@ -224,6 +215,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
return;
}

// Confirmation query.
if ((ec = query.block_confirmable(link)))
{
if (ec == database::error::integrity)
Expand Down Expand Up @@ -287,6 +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);
return;
}

Expand Down
5 changes: 1 addition & 4 deletions src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ void chaser_validate::validate_block(const header_link& link) NOEXCEPT
block->populate();
if (!query.populate(*block))
{
// This could instead be a case of invalid milestone.
////POST(complete_block, error::validate3, link, ctx.height);
////POST(complete_block, error::validate3, link, ctx.height);
boost::asio::post(strand_,
BIND(complete_block, error::validate3, link, ctx.height));
return;
Expand All @@ -253,9 +252,7 @@ void chaser_validate::validate_block(const header_link& link) NOEXCEPT
((ec = block->connect(ctx))))
{
if (!query.set_block_unconfirmable(link))
{
ec = error::validate4;
}
}
else if (!query.set_block_valid(link))
{
Expand Down

0 comments on commit 2483d0a

Please sign in to comment.