Skip to content

Commit

Permalink
Comments, logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Apr 15, 2024
1 parent 4b736c4 commit 84b10a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions include/bitcoin/node/impl/chasers/chaser_organize.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ void CLASS::do_organize(typename Block::cptr& block_ptr,

// Delay so headers can get current before block download starts.
// Checking currency before notify also avoids excessive work backlog.

// If all headers are previously associated then no blocks will be fed to
// preconfirmation, resulting in a stall...

if (is_block() || is_current(header.timestamp()))
notify(error::success, chase_object(), branch_point);

Expand Down Expand Up @@ -465,8 +469,6 @@ void CLASS::do_disorganize(header_t link) NOEXCEPT

for (auto index = top_candidate; index > fork_point; --index)
{
LOGN("Reorganizing candidate [" << index << "].");

if (!query.pop_candidate())
{
fault(error::store_integrity);
Expand Down
1 change: 1 addition & 0 deletions src/chasers/chaser_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void chaser_check::handle_event(const code&, chase event_,
// add headers
// ----------------------------------------------------------------------------

// TODO: create a tracking map with hashes only?
// Due to a race with header organization more current headers and branch
// points may be created while preceding headers messages are in transit. That
// can result in the branch->top scan finding the same unassociated headers
Expand Down
7 changes: 6 additions & 1 deletion src/chasers/chaser_preconfirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ void chaser_preconfirm::handle_event(const code&, chase event_,
POST(do_checked, height_t{});
break;
}
case chase::header:
{
POST(do_checked, height_t{});
break;
}
case chase::checked:
{
POST(do_height_checked, possible_narrow_cast<height_t>(value));
Expand All @@ -84,7 +89,7 @@ void chaser_preconfirm::handle_event(const code&, chase event_,
case chase::stall:
case chase::purge:
case chase::block:
case chase::header:
////case chase::header:
case chase::download:
////case chase::checked:
case chase::unchecked:
Expand Down

0 comments on commit 84b10a3

Please sign in to comment.