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
13 changes: 13 additions & 0 deletions include/bitcoin/database/impl/query/validate.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ namespace database {
// States.
// ----------------------------------------------------------------------------

TEMPLATE
bool CLASS::is_validateable(size_t height) const NOEXCEPT
{
const auto ec = get_block_state(to_candidate(height));

// First block state should be unvalidated, valid, or confirmable.
return
(ec == database::error::unvalidated) ||
(ec == database::error::block_valid) ||
(ec == database::error::unknown_state) ||
(ec == database::error::block_confirmable);
}

// protected
TEMPLATE
inline code CLASS::to_block_code(
Expand Down
1 change: 1 addition & 0 deletions include/bitcoin/database/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ class query
/// -----------------------------------------------------------------------

/// States.
bool is_validateable(size_t height) const NOEXCEPT;
uint64_t get_tx_fee(const tx_link& link) const NOEXCEPT;
uint64_t get_block_fees(const header_link& link) const NOEXCEPT;
code get_block_state(const header_link& link) const NOEXCEPT;
Expand Down
Loading