Skip to content

Commit e7cf641

Browse files
committed
Style.
1 parent afd7c13 commit e7cf641

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/chasers/chaser_check.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,12 @@ void chaser_check::do_confirmable(height_t height) NOEXCEPT
209209
{
210210
BC_ASSERT(stranded());
211211

212-
// Confirmations are ordered, but notification order isn't guaranteed.
213-
if (confirmed_ > height)
214-
confirmed_ = height;
212+
// Confirmations are ordered and notification order is guaranteed.
213+
confirmed_ = height;
215214

216215
// The full set of requested hashes has been confirmed.
217216
if (confirmed_ == requested_)
218-
do_headers(height_t{});
217+
do_headers(height);
219218
}
220219

221220
void chaser_check::do_checked(height_t height) NOEXCEPT
@@ -234,14 +233,17 @@ void chaser_check::do_bump(height_t) NOEXCEPT
234233
return;
235234

236235
const auto& query = archive();
236+
auto height = position();
237237

238238
// TODO: query.is_associated() is expensive (hashmap search).
239239
// Skip checked blocks starting immediately after last checked.
240-
while (!closed() && query.is_associated(
241-
query.to_candidate(add1(position()))))
242-
set_position(add1(position()));
240+
while (!closed() &&
241+
query.is_associated(query.to_candidate((height = add1(height)))))
242+
{
243+
set_position(height);
244+
}
243245

244-
do_headers(height_t{});
246+
do_headers(sub1(height));
245247
}
246248

247249
// add headers

0 commit comments

Comments
 (0)