Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/bitcoin/node/chasers/chaser_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BCN_API chaser_block

/// Query store for const pointer to Block instance by candidate height.
bool get_block(system::chain::block::cptr& out,
size_t height) const NOEXCEPT override;
const header_link& link) const NOEXCEPT override;

/// Determine if Block is a duplicate (success for not duplicate).
code duplicate(size_t& height,
Expand Down
8 changes: 5 additions & 3 deletions include/bitcoin/node/chasers/chaser_confirm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class BCN_API chaser_confirm
protected:
using header_link = database::header_link;
using header_links = database::header_links;
using header_states = database::header_states;

virtual bool handle_event(const code& ec, chase event_,
event_value value) NOEXCEPT;
Expand All @@ -51,12 +52,13 @@ class BCN_API chaser_confirm
virtual void do_bumped(height_t height) NOEXCEPT;
virtual void do_bump(height_t height) NOEXCEPT;

virtual void reorganize(header_links& fork, size_t fork_point) NOEXCEPT;
virtual void organize(header_links& fork, const header_links& popped,
virtual void reorganize(header_states& fork, size_t top,
size_t fork_point) NOEXCEPT;
virtual void organize(header_states& fork, const header_links& popped,
size_t fork_point) NOEXCEPT;
virtual bool confirm_block(const header_link& link,
size_t height, const header_links& popped, size_t fork_point) NOEXCEPT;
virtual void complete_block(const code& ec, const header_link& link,
virtual bool complete_block(const code& ec, const header_link& link,
size_t height, bool bypassed) NOEXCEPT;

private:
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/node/chasers/chaser_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BCN_API chaser_header

/// Query store for const pointer to Block instance by candidate height.
bool get_block(system::chain::header::cptr& out,
size_t height) const NOEXCEPT override;
const header_link& link) const NOEXCEPT override;

/// Determine if Block is a duplicate (success for not duplicate).
code duplicate(size_t& height,
Expand Down
17 changes: 8 additions & 9 deletions include/bitcoin/node/chasers/chaser_organize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class chaser_organize
chain_state::cptr state;
};
using block_tree = std::unordered_map<system::hash_cref, block_state>;
using header_links = std_vector<database::header_link>;
using header_link = database::header_link;

/// Protected constructor for abstract base.
chaser_organize(full_node& node) NOEXCEPT;
Expand All @@ -66,9 +66,9 @@ class chaser_organize
virtual const system::chain::header& get_header(
const Block& block) const NOEXCEPT = 0;

/// Query store for const pointer to Block instance by candidate height.
/// Query store for const pointer to Block instance by link.
virtual bool get_block(typename Block::cptr& out,
size_t height) const NOEXCEPT = 0;
const header_link& link) const NOEXCEPT = 0;

/// Determine if Block is a duplicate (success for not duplicate).
virtual code duplicate(size_t& height,
Expand Down Expand Up @@ -112,6 +112,9 @@ class chaser_organize
virtual const system::settings& settings() const NOEXCEPT;

private:
using header_links = database::header_links;
using header_states = database::header_states;

// Template differetiators.
// ------------------------------------------------------------------------

Expand Down Expand Up @@ -162,14 +165,10 @@ class chaser_organize
const system::hash_digest& previous_hash) const NOEXCEPT;

// Sum of work from header to branch point (excluded).
bool get_branch_work(uint256_t& branch_work, size_t& branch_point,
system::hashes& tree_branch, header_links& store_branch,
bool get_branch_work(uint256_t& branch_work,
system::hashes& tree_branch, header_states& store_branch,
const system::chain::header& header) const NOEXCEPT;

// True if work represents a stronger candidate branch.
bool get_is_strong(bool& strong, const uint256_t& branch_work,
size_t branch_point) const NOEXCEPT;

// Logging.
// ------------------------------------------------------------------------

Expand Down
Loading
Loading