File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,19 @@ namespace database {
2929// States.
3030// ----------------------------------------------------------------------------
3131
32+ TEMPLATE
33+ bool CLASS::is_validateable (size_t height) const NOEXCEPT
34+ {
35+ const auto ec = get_block_state (to_candidate (height));
36+
37+ // First block state should be unvalidated, valid, or confirmable.
38+ return
39+ (ec == database::error::unvalidated) ||
40+ (ec == database::error::block_valid) ||
41+ (ec == database::error::unknown_state) ||
42+ (ec == database::error::block_confirmable);
43+ }
44+
3245// protected
3346TEMPLATE
3447inline code CLASS::to_block_code (
Original file line number Diff line number Diff line change @@ -457,6 +457,7 @@ class query
457457 // / -----------------------------------------------------------------------
458458
459459 // / States.
460+ bool is_validateable (size_t height) const NOEXCEPT;
460461 uint64_t get_tx_fee (const tx_link& link) const NOEXCEPT;
461462 uint64_t get_block_fees (const header_link& link) const NOEXCEPT;
462463 code get_block_state (const header_link& link) const NOEXCEPT;
You can’t perform that action at this time.
0 commit comments