Skip to content

Commit 439a9d1

Browse files
committed
Hack in get_point_rate().
1 parent 1d294ee commit 439a9d1

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ CLASS::query(Store& store) NOEXCEPT
7474
{
7575
}
7676

77+
TEMPLATE
78+
uint64_t CLASS::get_point_rate() const NOEXCEPT
79+
{
80+
const auto negative = (double)store_.point.negative_search_count();
81+
const auto positive = (double)store_.point.positive_search_count();
82+
return static_cast<uint64_t>(10'000.0 * (positive / (positive + negative)));
83+
}
84+
7785
TEMPLATE
7886
code CLASS::get_code() const NOEXCEPT
7987
{

include/bitcoin/database/query.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ class query
8585
/// Get first fault code.
8686
code get_fault() const NOEXCEPT;
8787

88+
// TESTING
89+
uint64_t get_point_rate() const NOEXCEPT;
90+
8891
/// True if there is a fault condition (disk full is not a fault).
8992
bool is_fault() const NOEXCEPT;
9093

0 commit comments

Comments
 (0)