Skip to content

Commit 514ee1e

Browse files
authored
Merge pull request #652 from evoskuil/master
Fix get_locator_span lower limit.
2 parents b5927b1 + d304c27 commit 514ee1e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ CLASS::span CLASS::get_locator_span(const hashes& locator,
7979
const hash_digest& stop, size_t limit) const NOEXCEPT
8080
{
8181
using namespace system;
82-
span out{};
8382

8483
// Start at fork point, stop at given header (both excluded).
8584
const auto start = add1(get_fork(locator));
@@ -94,9 +93,12 @@ CLASS::span CLASS::get_locator_span(const hashes& locator,
9493
const auto top1 = ceilinged_add(get_top_confirmed(), one);
9594
const auto end = std::min(ceilinged_add(start, allowed), top1);
9695

97-
// Convert negative range to empty.
98-
out.end = std::max(start, end);
99-
return out;
96+
// max converts negative range to empty.
97+
return
98+
{
99+
start,
100+
std::max(start, end)
101+
};
100102
}
101103

102104
// protected

0 commit comments

Comments
 (0)