Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | struct AvalancheTestingSetup : public TestChain100Setup { | ||||
~AvalancheTestingSetup() { m_connman->ClearNodes(); } | ~AvalancheTestingSetup() { m_connman->ClearNodes(); } | ||||
CNode *ConnectNode(ServiceFlags nServices) { | CNode *ConnectNode(ServiceFlags nServices) { | ||||
static NodeId id = 0; | static NodeId id = 0; | ||||
CAddress addr(ip(GetRandInt(0xffffffff)), NODE_NONE); | CAddress addr(ip(GetRandInt(0xffffffff)), NODE_NONE); | ||||
auto node = | auto node = | ||||
new CNode(id++, ServiceFlags(NODE_NETWORK), 0, INVALID_SOCKET, addr, | new CNode(id++, ServiceFlags(NODE_NETWORK), 0, INVALID_SOCKET, addr, | ||||
0, 0, CAddress(), "", ConnectionType::OUTBOUND); | 0, 0, 0, CAddress(), "", ConnectionType::OUTBOUND); | ||||
node->SetSendVersion(PROTOCOL_VERSION); | node->SetSendVersion(PROTOCOL_VERSION); | ||||
node->nServices = nServices; | node->nServices = nServices; | ||||
m_node.peer_logic->InitializeNode(config, node); | m_node.peer_logic->InitializeNode(config, node); | ||||
node->nVersion = 1; | node->nVersion = 1; | ||||
node->fSuccessfullyConnected = true; | node->fSuccessfullyConnected = true; | ||||
m_connman->AddNode(*node); | m_connman->AddNode(*node); | ||||
return node; | return node; | ||||
▲ Show 20 Lines • Show All 858 Lines • Show Last 20 Lines |