mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-17 13:22:03 +01:00
Merge fa4fb6a8f15c295a2a3d3ffd737e115b8be46c1f into 5f4422d68dc3530c353af1f87499de1c864b60ad
This commit is contained in:
commit
bfab477824
@ -49,6 +49,7 @@
|
||||
#include <util/rbf.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
#include <util/task_runner.h>
|
||||
#include <util/thread.h>
|
||||
#include <util/threadnames.h>
|
||||
#include <util/time.h>
|
||||
@ -220,12 +221,15 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, TestOpts opts)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
|
||||
// We have to run a scheduler thread to prevent ActivateBestChain
|
||||
// A task runner is required to prevent ActivateBestChain
|
||||
// from blocking due to queue overrun.
|
||||
if (opts.setup_validation_interface) {
|
||||
m_node.scheduler = std::make_unique<CScheduler>();
|
||||
m_node.scheduler->m_service_thread = std::thread(util::TraceThread, "scheduler", [&] { m_node.scheduler->serviceQueue(); });
|
||||
m_node.validation_signals = std::make_unique<ValidationSignals>(std::make_unique<SerialTaskRunner>(*m_node.scheduler));
|
||||
m_node.validation_signals =
|
||||
// Use synchronous task runner while fuzzing to avoid non-determinism
|
||||
G_FUZZING ? std::make_unique<ValidationSignals>(std::make_unique<util::ImmediateTaskRunner>()) :
|
||||
std::make_unique<ValidationSignals>(std::make_unique<SerialTaskRunner>(*m_node.scheduler));
|
||||
}
|
||||
|
||||
bilingual_str error{};
|
||||
|
Loading…
x
Reference in New Issue
Block a user