We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8445301 commit e2d652aCopy full SHA for e2d652a
1 file changed
include/bitcoin/database/impl/query/height.ipp
@@ -263,8 +263,8 @@ header_links CLASS::get_confirmed_headers(size_t first,
263
return {};
264
265
// add1(top) cannot overflow, as indexed block maximum cannot exceed size_t.
266
- limit = std::min(limit, add1(top) - first);
267
- auto last = first + sub1(limit);
+ limit = std::min(limit, add1(top - first));
+ auto last = sub1(first + limit);
268
269
// Due to reorganization it is possible for this height to now be terminal.
270
auto link = to_confirmed(last);
0 commit comments