Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/bitcoin/node/chasers/chaser_validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BCN_API chaser_validate
template <class Derived, typename Method, typename... Args>
inline auto parallel(Method&& method, Args&&... args) NOEXCEPT
{
return boost::asio::post(threadpool_.service(),
return boost::asio::post(validation_threadpool_.service(),
BIND_THIS(method, args));
}

Expand Down Expand Up @@ -79,11 +79,11 @@ class BCN_API chaser_validate

private:
// This is protected by strand.
network::threadpool threadpool_;
network::threadpool validation_threadpool_;

// These are thread safe.
std::atomic<size_t> backlog_{};
network::asio::strand independent_strand_;
network::asio::strand validation_strand_;
const uint32_t subsidy_interval_;
const uint64_t initial_subsidy_;
const size_t maximum_backlog_;
Expand Down
12 changes: 6 additions & 6 deletions src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
// Independent threadpool and strand (base class strand uses network pool).
chaser_validate::chaser_validate(full_node& node) NOEXCEPT
: chaser(node),
threadpool_(node.node_settings().threads_(),
validation_threadpool_(node.node_settings().threads_(),
node.node_settings().thread_priority_()),
independent_strand_(threadpool_.service().get_executor()),
validation_strand_(validation_threadpool_.service().get_executor()),
subsidy_interval_(node.system_settings().subsidy_interval_blocks),
initial_subsidy_(node.system_settings().initial_subsidy()),
maximum_backlog_(node.node_settings().maximum_concurrency_()),
Expand Down Expand Up @@ -342,13 +342,13 @@ void chaser_validate::complete_block(const code& ec, const header_link& link,
void chaser_validate::stopping(const code& ec) NOEXCEPT
{
// Stop threadpool keep-alive, all work must self-terminate to affect join.
threadpool_.stop();
validation_threadpool_.stop();
chaser::stopping(ec);
}

void chaser_validate::stop() NOEXCEPT
{
if (!threadpool_.join())
if (!validation_threadpool_.join())
{
BC_ASSERT_MSG(false, "failed to join threadpool");
std::abort();
Expand All @@ -357,12 +357,12 @@ void chaser_validate::stop() NOEXCEPT

network::asio::strand& chaser_validate::strand() NOEXCEPT
{
return independent_strand_;
return validation_strand_;
}

bool chaser_validate::stranded() const NOEXCEPT
{
return independent_strand_.running_in_this_thread();
return validation_strand_.running_in_this_thread();
}

BC_POP_WARNING()
Expand Down
Loading