mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Add CConnmanTest to mutate g_connman in tests
This commit is contained in:
committed by
Suhas Daftuar
parent
ac7b37cd2b
commit
83df25736e
@@ -25,6 +25,18 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
void CConnmanTest::AddNode(CNode& node)
|
||||
{
|
||||
LOCK(g_connman->cs_vNodes);
|
||||
g_connman->vNodes.push_back(&node);
|
||||
}
|
||||
|
||||
void CConnmanTest::ClearNodes()
|
||||
{
|
||||
LOCK(g_connman->cs_vNodes);
|
||||
g_connman->vNodes.clear();
|
||||
}
|
||||
|
||||
uint256 insecure_rand_seed = GetRandHash();
|
||||
FastRandomContext insecure_rand_ctx(insecure_rand_seed);
|
||||
|
||||
|
||||
@@ -49,6 +49,12 @@ struct BasicTestingSetup {
|
||||
* Included are data directory, coins database, script check threads setup.
|
||||
*/
|
||||
class CConnman;
|
||||
class CNode;
|
||||
struct CConnmanTest {
|
||||
static void AddNode(CNode& node);
|
||||
static void ClearNodes();
|
||||
};
|
||||
|
||||
class PeerLogicValidation;
|
||||
struct TestingSetup: public BasicTestingSetup {
|
||||
CCoinsViewDB *pcoinsdbview;
|
||||
|
||||
Reference in New Issue
Block a user