Skip to content

Commit

Permalink
Use override vs. virtual for pure virtual implementations.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jun 27, 2024
1 parent 6318bb3 commit 112c403
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
26 changes: 13 additions & 13 deletions include/bitcoin/node/chasers/chaser_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,33 @@ class BCN_API chaser_block

protected:
/// Get header from Block instance.
virtual const system::chain::header& get_header(
const system::chain::block& block) const NOEXCEPT;
const system::chain::header& get_header(
const system::chain::block& block) const NOEXCEPT override;

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

/// Determine if Block is a duplicate (success for not duplicate).
virtual code duplicate(size_t& height,
const system::hash_digest& hash) const NOEXCEPT;
code duplicate(size_t& height,
const system::hash_digest& hash) const NOEXCEPT override;

/// Determine if Block is valid.
virtual code validate(const system::chain::block& block,
const chain_state& state) const NOEXCEPT;
code validate(const system::chain::block& block,
const chain_state& state) const NOEXCEPT override;

/// Notify check chaser to redownload the block (nop).
virtual void do_malleated(header_t link) NOEXCEPT;
void do_malleated(header_t link) NOEXCEPT override;

/// Determine if state is top of a storable branch (always true).
virtual bool is_storable(const chain_state& state) const NOEXCEPT;
bool is_storable(const chain_state& state) const NOEXCEPT override;

/// True if Block is on a milestone-covered branch.
virtual bool is_under_milestone(size_t height) const NOEXCEPT;
bool is_under_milestone(size_t height) const NOEXCEPT override;

/// Milestone tracking.
virtual void update_milestone(const system::chain::header& header,
size_t height, size_t branch_point) NOEXCEPT;
void update_milestone(const system::chain::header& header,
size_t height, size_t branch_point) NOEXCEPT override;

private:
void set_prevout(const system::chain::input& input) const NOEXCEPT;
Expand Down
26 changes: 13 additions & 13 deletions include/bitcoin/node/chasers/chaser_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ class BCN_API chaser_header

protected:
/// Get header from Block instance.
virtual const system::chain::header& get_header(
const system::chain::header& header) const NOEXCEPT;
const system::chain::header& get_header(
const system::chain::header& header) const NOEXCEPT override;

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

/// Determine if Block is a duplicate (success for not duplicate).
virtual code duplicate(size_t& height,
const system::hash_digest& hash) const NOEXCEPT;
code duplicate(size_t& height,
const system::hash_digest& hash) const NOEXCEPT override;

/// Determine if Block is valid.
virtual code validate(const system::chain::header& header,
const chain_state& state) const NOEXCEPT;
code validate(const system::chain::header& header,
const chain_state& state) const NOEXCEPT override;

/// Notify check chaser to redownload the block.
virtual void do_malleated(header_t link) NOEXCEPT;
void do_malleated(header_t link) NOEXCEPT override;

/// Determine if state is top of a storable branch.
virtual bool is_storable(const chain_state& state) const NOEXCEPT;
bool is_storable(const chain_state& state) const NOEXCEPT override;

/// True if Block is on a milestone-covered branch.
virtual bool is_under_milestone(size_t height) const NOEXCEPT;
bool is_under_milestone(size_t height) const NOEXCEPT override;

/// Milestone tracking.
virtual void update_milestone(const system::chain::header& header,
size_t height, size_t branch_point) NOEXCEPT;
void update_milestone(const system::chain::header& header,
size_t height, size_t branch_point) NOEXCEPT override;

private:
bool is_checkpoint(const chain_state& state) const NOEXCEPT;
Expand Down

0 comments on commit 112c403

Please sign in to comment.