Skip to content

Commit

Permalink
Style, logging, comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Mar 15, 2024
1 parent ad12208 commit 12b94c9
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 246 deletions.
24 changes: 24 additions & 0 deletions include/bitcoin/node/chasers/chaser_organize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class chaser_organize
using block_tree = std::unordered_map<system::hash_digest, block_state>;
using header_links = std::vector<database::header_link>;

/// Pure Virtual
/// -----------------------------------------------------------------------

/// Get header from Block instance.
virtual const system::chain::header& get_header(
const Block& block) const NOEXCEPT = 0;
Expand All @@ -75,12 +78,18 @@ class chaser_organize
virtual bool is_storable(const Block& block,
const chain_state& state) const NOEXCEPT = 0;

/// Properties
/// -----------------------------------------------------------------------

/// Constant access to Block tree.
virtual const block_tree& tree() const NOEXCEPT;

/// System configuration settings.
virtual const system::settings& settings() const NOEXCEPT;

/// Methods
/// -----------------------------------------------------------------------

/// Handle chaser events.
virtual void handle_event(const code&, chase event_, link value) NOEXCEPT;

Expand All @@ -92,6 +101,12 @@ class chaser_organize
const organize_handler& handler) NOEXCEPT;

private:
static constexpr size_t fork_bits = to_bits(sizeof(system::chain::forks));
static constexpr bool is_block() NOEXCEPT
{
return is_same_type<Block, system::chain::block>;
}

// Store Block into logical tree cache.
void cache(const typename Block::cptr& block_ptr,
const chain_state::ptr& state) NOEXCEPT;
Expand Down Expand Up @@ -127,6 +142,15 @@ class chaser_organize
} // namespace node
} // namespace libbitcoin

#define TEMPLATE template <typename Block>
#define CLASS chaser_organize<Block>

BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)

#include <bitcoin/node/impl/chasers/chaser_organize.ipp>

BC_POP_WARNING()

#undef CLASS

#endif
Loading

0 comments on commit 12b94c9

Please sign in to comment.