Skip to content

Commit

Permalink
Comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Feb 16, 2024
1 parent c4d083c commit 525416e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/bitcoin/node/chasers/chaser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace node {

class full_node;

/// Abstract base chaser.
/// Abstract base chaser for thread safe chain state management classes.
/// Chasers impose order on blockchain/pool construction as necessary.
/// Each chaser operates on its own strand, implemented here, allowing
/// concurrent chaser operations to the extent that threads are available.
Expand Down
10 changes: 8 additions & 2 deletions src/chasers/chaser_header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ void chaser_header::do_organize(const chain::header::cptr& header,
{
BC_ASSERT_MSG(stranded(), "chaser_header");

// Determine if work should be computed.
// ------------------------------------------------------------------------

auto& query = archive();
const auto hash = header->hash();
if (tree_.contains(hash) || query.is_header(hash))
Expand All @@ -101,6 +104,9 @@ void chaser_header::do_organize(const chain::header::cptr& header,
return;
}

// Compute relative work.
// ------------------------------------------------------------------------

size_t point{};
uint256_t work{};
hashes tree_branch{};
Expand All @@ -125,7 +131,7 @@ void chaser_header::do_organize(const chain::header::cptr& header,
return;
}

// Candidate chain reorganization
// Reorganize candidate chain.
// ------------------------------------------------------------------------

// Obtain the top height.
Expand Down Expand Up @@ -174,9 +180,9 @@ void chaser_header::do_organize(const chain::header::cptr& header,
return;
}

// Notify reorganization with branch point.
// ------------------------------------------------------------------------

// Notify of candidate reorganization with branch point.
notify(error::success, chase::header,
{ possible_narrow_cast<height_t>(point) });
}
Expand Down

0 comments on commit 525416e

Please sign in to comment.