File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -431,6 +431,8 @@ class CConnman
431
431
* in excess of nMaxOutbound
432
432
* This takes the place of a feeler connection */
433
433
std::atomic_bool m_try_another_outbound_peer;
434
+
435
+ friend struct CConnmanTest ;
434
436
};
435
437
extern std::unique_ptr<CConnman> g_connman;
436
438
void Discover (boost::thread_group& threadGroup);
Original file line number Diff line number Diff line change 25
25
26
26
#include < memory>
27
27
28
+ void CConnmanTest::AddNode (CNode& node)
29
+ {
30
+ LOCK (g_connman->cs_vNodes );
31
+ g_connman->vNodes .push_back (&node);
32
+ }
33
+
34
+ void CConnmanTest::ClearNodes ()
35
+ {
36
+ LOCK (g_connman->cs_vNodes );
37
+ g_connman->vNodes .clear ();
38
+ }
39
+
28
40
uint256 insecure_rand_seed = GetRandHash();
29
41
FastRandomContext insecure_rand_ctx (insecure_rand_seed);
30
42
Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ struct BasicTestingSetup {
49
49
* Included are data directory, coins database, script check threads setup.
50
50
*/
51
51
class CConnman ;
52
+ class CNode ;
53
+ struct CConnmanTest {
54
+ static void AddNode (CNode& node);
55
+ static void ClearNodes ();
56
+ };
57
+
52
58
class PeerLogicValidation ;
53
59
struct TestingSetup : public BasicTestingSetup {
54
60
CCoinsViewDB *pcoinsdbview;
You can’t perform that action at this time.
0 commit comments