Skip to content

Commit edf6cbf

Browse files
committed
Advance concurrency window on validation.
1 parent cf7ef3e commit edf6cbf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/bitcoin/node/chasers/chaser_check.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ class BCN_API chaser_check
6161

6262
virtual void do_bump(height_t height) NOEXCEPT;
6363
virtual void do_checked(height_t height) NOEXCEPT;
64+
virtual void do_advanced(height_t height) NOEXCEPT;
6465
virtual void do_headers(height_t branch_point) NOEXCEPT;
6566
virtual void do_regressed(height_t branch_point) NOEXCEPT;
6667
virtual void do_handle_purged(const code& ec) NOEXCEPT;
6768
virtual void do_get_hashes(const map_handler& handler) NOEXCEPT;
6869
virtual void do_put_hashes(const map_ptr& map,
6970
const network::result_handler& handler) NOEXCEPT;
70-
virtual void do_confirmable(height_t height) NOEXCEPT;
7171

7272
private:
7373
typedef std::deque<map_ptr> maps;
@@ -89,7 +89,7 @@ class BCN_API chaser_check
8989
// These are protected by strand.
9090
size_t inventory_{};
9191
size_t requested_{};
92-
size_t confirmed_{};
92+
size_t advanced_{};
9393
job::ptr job_{};
9494
maps maps_{};
9595
};

src/chasers/chaser_check.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ bool chaser_check::handle_event(const code&, chase event_,
129129
POST(do_headers, std::get<height_t>(value));
130130
break;
131131
}
132-
case chase::confirmable:
132+
////case chase::confirmable:
133+
case chase::valid:
133134
{
134135
BC_ASSERT(std::holds_alternative<height_t>(value));
135-
POST(do_confirmable, std::get<height_t>(value));
136+
POST(do_advanced, std::get<height_t>(value));
136137
break;
137138
}
138139
case chase::stop:
@@ -205,15 +206,15 @@ void chaser_check::do_regressed(height_t branch_point) NOEXCEPT
205206
// track downloaded in order (to move download window)
206207
// ----------------------------------------------------------------------------
207208

208-
void chaser_check::do_confirmable(height_t height) NOEXCEPT
209+
void chaser_check::do_advanced(height_t height) NOEXCEPT
209210
{
210211
BC_ASSERT(stranded());
211212

212213
// Confirmations are ordered and notification order is guaranteed.
213-
confirmed_ = height;
214+
advanced_ = height;
214215

215216
// The full set of requested hashes has been confirmed.
216-
if (confirmed_ == requested_)
217+
if (advanced_ == requested_)
217218
do_headers(height);
218219
}
219220

@@ -345,8 +346,7 @@ size_t chaser_check::set_unassociated() NOEXCEPT
345346
return {};
346347

347348
// Defer new work issuance until gaps filled and confirmation caught up.
348-
if (position() < requested_ ||
349-
confirmed_ < requested_)
349+
if (position() < requested_ || advanced_ < requested_)
350350
return {};
351351

352352
// Inventory size gets set only once.

0 commit comments

Comments
 (0)