mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-09 13:44:26 +00:00
Add CConnmanTest to mutate g_connman in tests
This commit is contained in:
parent
ac7b37cd2b
commit
83df25736e
@ -431,6 +431,8 @@ private:
|
|||||||
* in excess of nMaxOutbound
|
* in excess of nMaxOutbound
|
||||||
* This takes the place of a feeler connection */
|
* This takes the place of a feeler connection */
|
||||||
std::atomic_bool m_try_another_outbound_peer;
|
std::atomic_bool m_try_another_outbound_peer;
|
||||||
|
|
||||||
|
friend struct CConnmanTest;
|
||||||
};
|
};
|
||||||
extern std::unique_ptr<CConnman> g_connman;
|
extern std::unique_ptr<CConnman> g_connman;
|
||||||
void Discover(boost::thread_group& threadGroup);
|
void Discover(boost::thread_group& threadGroup);
|
||||||
|
@ -25,6 +25,18 @@
|
|||||||
|
|
||||||
#include <memory>
|
#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();
|
uint256 insecure_rand_seed = GetRandHash();
|
||||||
FastRandomContext insecure_rand_ctx(insecure_rand_seed);
|
FastRandomContext insecure_rand_ctx(insecure_rand_seed);
|
||||||
|
|
||||||
|
@ -49,6 +49,12 @@ struct BasicTestingSetup {
|
|||||||
* Included are data directory, coins database, script check threads setup.
|
* Included are data directory, coins database, script check threads setup.
|
||||||
*/
|
*/
|
||||||
class CConnman;
|
class CConnman;
|
||||||
|
class CNode;
|
||||||
|
struct CConnmanTest {
|
||||||
|
static void AddNode(CNode& node);
|
||||||
|
static void ClearNodes();
|
||||||
|
};
|
||||||
|
|
||||||
class PeerLogicValidation;
|
class PeerLogicValidation;
|
||||||
struct TestingSetup: public BasicTestingSetup {
|
struct TestingSetup: public BasicTestingSetup {
|
||||||
CCoinsViewDB *pcoinsdbview;
|
CCoinsViewDB *pcoinsdbview;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user