Skip to content

Commit a8135ee

Browse files
authored
Merge pull request #701 from evoskuil/master
Add get_top_confirmed_hash().
2 parents 9326b32 + 28f68f8 commit a8135ee

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/bitcoin/database/impl/query/archive_read.ipp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ inline bool CLASS::is_valid(const header_link& link) const NOEXCEPT
8686
// Empty/null_hash implies fault, zero count implies unassociated.
8787
// ----------------------------------------------------------------------------
8888

89+
TEMPLATE
90+
hash_digest CLASS::get_top_confirmed_hash() const NOEXCEPT
91+
{
92+
return get_header_key(to_confirmed(get_top_confirmed()));
93+
}
94+
95+
TEMPLATE
96+
hash_digest CLASS::get_top_candidate_hash() const NOEXCEPT
97+
{
98+
return get_header_key(to_candidate(get_top_candidate()));
99+
}
100+
89101
TEMPLATE
90102
hashes CLASS::get_tx_keys(const header_link& link) const NOEXCEPT
91103
{

include/bitcoin/database/query.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ class query
331331
inline bool is_valid(const header_link& link) const NOEXCEPT;
332332

333333
/// Empty/null_hash implies fault, zero count implies unassociated.
334+
hash_digest get_top_confirmed_hash() const NOEXCEPT;
335+
hash_digest get_top_candidate_hash() const NOEXCEPT;
334336
hashes get_tx_keys(const header_link& link) const NOEXCEPT;
335337
size_t get_tx_count(const header_link& link) const NOEXCEPT;
336338
inline hash_digest get_header_key(const header_link& link) const NOEXCEPT;

0 commit comments

Comments
 (0)