Skip to content

Commit 4016527

Browse files
authored
Merge pull request #727 from evoskuil/master
Fix stall, style.
2 parents 669f38e + 6d4ae8f commit 4016527

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

src/chasers/chaser_check.cpp

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -148,33 +148,6 @@ bool chaser_check::handle_event(const code&, chase event_,
148148
return true;
149149
}
150150

151-
void chaser_check::do_confirmable(height_t height) NOEXCEPT
152-
{
153-
BC_ASSERT(stranded());
154-
confirmed_ = height;
155-
156-
if (confirmed_ == requested_)
157-
do_headers(height_t{});
158-
}
159-
160-
// regression
161-
// ----------------------------------------------------------------------------
162-
163-
void chaser_check::do_regressed(height_t branch_point) NOEXCEPT
164-
{
165-
BC_ASSERT(stranded());
166-
167-
// Inconsequential regression, work isn't there yet.
168-
if (branch_point >= position())
169-
return;
170-
171-
// Update position, purge outstanding work, and wait on track completion.
172-
set_position(branch_point);
173-
stop_tracking();
174-
maps_.clear();
175-
notify(error::success, chase::purge, branch_point);
176-
}
177-
178151
void chaser_check::start_tracking() NOEXCEPT
179152
{
180153
// Called from start.
@@ -211,9 +184,40 @@ void chaser_check::do_handle_purged(const code&) NOEXCEPT
211184
do_bump(height_t{});
212185
}
213186

187+
// regression
188+
// ----------------------------------------------------------------------------
189+
190+
void chaser_check::do_regressed(height_t branch_point) NOEXCEPT
191+
{
192+
BC_ASSERT(stranded());
193+
194+
// Inconsequential regression, work isn't there yet.
195+
if (branch_point >= position())
196+
return;
197+
198+
// Update position, purge outstanding work, and wait on track completion.
199+
set_position(branch_point);
200+
stop_tracking();
201+
maps_.clear();
202+
notify(error::success, chase::purge, branch_point);
203+
}
204+
214205
// track downloaded in order (to move download window)
215206
// ----------------------------------------------------------------------------
216207

208+
void chaser_check::do_confirmable(height_t height) NOEXCEPT
209+
{
210+
BC_ASSERT(stranded());
211+
212+
// Confirmations are ordered, but notification order isn't guaranteed.
213+
if (confirmed_ > height)
214+
confirmed_ = height;
215+
216+
// The full set of requested hashes has been confirmed.
217+
if (confirmed_ == requested_)
218+
do_headers(height_t{});
219+
}
220+
217221
void chaser_check::do_checked(height_t height) NOEXCEPT
218222
{
219223
BC_ASSERT(stranded());

0 commit comments

Comments
 (0)