Skip to content

Commit

Permalink
Merge pull request #730 from evoskuil/master
Browse files Browse the repository at this point in the history
Increase spend table start size, style.
  • Loading branch information
evoskuil authored Feb 6, 2025
2 parents 4016527 + e3b8514 commit 3dd2b00
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/chasers/chaser_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,12 @@ void chaser_check::do_confirmable(height_t height) NOEXCEPT
{
BC_ASSERT(stranded());

// Confirmations are ordered, but notification order isn't guaranteed.
if (confirmed_ > height)
confirmed_ = height;
// Confirmations are ordered and notification order is guaranteed.
confirmed_ = height;

// The full set of requested hashes has been confirmed.
if (confirmed_ == requested_)
do_headers(height_t{});
do_headers(height);
}

void chaser_check::do_checked(height_t height) NOEXCEPT
Expand All @@ -234,14 +233,17 @@ void chaser_check::do_bump(height_t) NOEXCEPT
return;

const auto& query = archive();
auto height = position();

// TODO: query.is_associated() is expensive (hashmap search).
// Skip checked blocks starting immediately after last checked.
while (!closed() && query.is_associated(
query.to_candidate(add1(position()))))
set_position(add1(position()));
while (!closed() &&
query.is_associated(query.to_candidate((height = add1(height)))))
{
set_position(height);
}

do_headers(height_t{});
do_headers(sub1(height));
}

// add headers
Expand Down

0 comments on commit 3dd2b00

Please sign in to comment.