aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_bitcoin.cpp')
-rw-r--r--src/test/test_bitcoin.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index 419106194e..bdd44489f4 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2011-2016 The Bitcoin Core developers
+// Copyright (c) 2011-2017 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -8,15 +8,9 @@
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <crypto/sha256.h>
-#include <fs.h>
-#include <key.h>
#include <validation.h>
#include <miner.h>
#include <net_processing.h>
-#include <pubkey.h>
-#include <random.h>
-#include <txdb.h>
-#include <txmempool.h>
#include <ui_interface.h>
#include <streams.h>
#include <rpc/server.h>
@@ -75,9 +69,9 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
fs::create_directories(pathTemp);
gArgs.ForceSetArg("-datadir", pathTemp.string());
- // Note that because we don't bother running a scheduler thread here,
- // callbacks via CValidationInterface are unreliable, but that's OK,
- // our unit tests aren't testing multiple parts of the code at once.
+ // We have to run a scheduler thread to prevent ActivateBestChain
+ // from blocking due to queue overrun.
+ threadGroup.create_thread(boost::bind(&CScheduler::serviceQueue, &scheduler));
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler);
mempool.setSanityCheck(1.0);