File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff 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
221220void 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
You can’t perform that action at this time.
0 commit comments