Skip to content

Commit a734466

Browse files
committed
Change get_branch_fees param from top to start.
1 parent 150b85c commit a734466

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ bool CLASS::get_block_fees(fee_rates& out,
8888

8989
TEMPLATE
9090
bool CLASS::get_branch_fees(std::atomic_bool& cancel, fee_rate_sets& out,
91-
size_t top, size_t count) const NOEXCEPT
91+
size_t start, size_t count) const NOEXCEPT
9292
{
9393
out.clear();
9494
if (is_zero(count))
9595
return true;
9696

97-
if (top > get_top_confirmed())
97+
if (system::is_add_overflow(start, sub1(count)))
9898
return false;
9999

100-
const auto start = top - sub1(count);
101-
if (system::is_subtract_overflow(top, sub1(count)))
100+
const auto last = start + sub1(count);
101+
if (last > get_top_confirmed())
102102
return false;
103103

104104
out.resize(count);

include/bitcoin/database/query.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ class query
409409
bool get_tx_fees(fee_rate& out, const tx_link& link) const NOEXCEPT;
410410
bool get_block_fees(fee_rates& out, const header_link& link) const NOEXCEPT;
411411
bool get_branch_fees(std::atomic_bool& cancel, fee_rate_sets& out,
412-
size_t top, size_t count) const NOEXCEPT;
412+
size_t start, size_t count) const NOEXCEPT;
413413

414414
/// Merkle.
415415
/// -----------------------------------------------------------------------

0 commit comments

Comments
 (0)