Skip to content

Commit faaa4f2

Browse files
author
MarcoFalke
committed
refactor: Remove nMyStartingHeight from CNode/Connman
1 parent ae8f797 commit faaa4f2

12 files changed

+33
-55
lines changed

src/init.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
18941894
}
18951895
}
18961896
LogPrintf("nBestHeight = %d\n", chain_active_height);
1897+
if (node.peerman) node.peerman->SetBestHeight(chain_active_height);
18971898

18981899
Discover();
18991900

@@ -1909,7 +1910,6 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
19091910
connOptions.m_max_outbound_block_relay = std::min(MAX_BLOCK_RELAY_ONLY_CONNECTIONS, connOptions.nMaxConnections-connOptions.m_max_outbound_full_relay);
19101911
connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS;
19111912
connOptions.nMaxFeeler = MAX_FEELER_CONNECTIONS;
1912-
connOptions.nBestHeight = chain_active_height;
19131913
connOptions.uiInterface = &uiInterface;
19141914
connOptions.m_banman = node.banman.get();
19151915
connOptions.m_msgproc = node.peerman.get();

src/net.cpp

+3-14
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
481481
NodeId id = GetNewNodeId();
482482
uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
483483
CAddress addr_bind = GetBindAddress(hSocket);
484-
CNode* pnode = new CNode(id, nLocalServices, GetBestHeight(), hSocket, addrConnect, CalculateKeyedNetGroup(addrConnect), nonce, addr_bind, pszDest ? pszDest : "", conn_type);
484+
CNode* pnode = new CNode(id, nLocalServices, hSocket, addrConnect, CalculateKeyedNetGroup(addrConnect), nonce, addr_bind, pszDest ? pszDest : "", conn_type);
485485
pnode->AddRef();
486486

487487
// We're making a new connection, harvest entropy from the time (and our peer count)
@@ -1116,7 +1116,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
11161116
}
11171117

11181118
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
1119-
CNode* pnode = new CNode(id, nodeServices, GetBestHeight(), hSocket, addr, CalculateKeyedNetGroup(addr), nonce, addr_bind, "", ConnectionType::INBOUND, inbound_onion);
1119+
CNode* pnode = new CNode(id, nodeServices, hSocket, addr, CalculateKeyedNetGroup(addr), nonce, addr_bind, "", ConnectionType::INBOUND, inbound_onion);
11201120
pnode->AddRef();
11211121
pnode->m_permissionFlags = permissionFlags;
11221122
pnode->m_prefer_evict = discouraged;
@@ -2923,19 +2923,9 @@ ServiceFlags CConnman::GetLocalServices() const
29232923
return nLocalServices;
29242924
}
29252925

2926-
void CConnman::SetBestHeight(int height)
2927-
{
2928-
nBestHeight.store(height, std::memory_order_release);
2929-
}
2930-
2931-
int CConnman::GetBestHeight() const
2932-
{
2933-
return nBestHeight.load(std::memory_order_acquire);
2934-
}
2935-
29362926
unsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; }
29372927

2938-
CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress& addrBindIn, const std::string& addrNameIn, ConnectionType conn_type_in, bool inbound_onion)
2928+
CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress& addrBindIn, const std::string& addrNameIn, ConnectionType conn_type_in, bool inbound_onion)
29392929
: nTimeConnected(GetSystemTimeInSeconds()),
29402930
addr(addrIn),
29412931
addrBind(addrBindIn),
@@ -2944,7 +2934,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
29442934
nLocalHostNonce(nLocalHostNonceIn),
29452935
m_conn_type(conn_type_in),
29462936
nLocalServices(nLocalServicesIn),
2947-
nMyStartingHeight(nMyStartingHeightIn),
29482937
m_inbound_onion(inbound_onion)
29492938
{
29502939
if (inbound_onion) assert(conn_type_in == ConnectionType::INBOUND);

src/net.h

+1-12
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ class CConnman
200200
int m_max_outbound_block_relay = 0;
201201
int nMaxAddnode = 0;
202202
int nMaxFeeler = 0;
203-
int nBestHeight = 0;
204203
CClientUIInterface* uiInterface = nullptr;
205204
NetEventsInterface* m_msgproc = nullptr;
206205
BanMan* m_banman = nullptr;
@@ -228,7 +227,6 @@ class CConnman
228227
nMaxAddnode = connOptions.nMaxAddnode;
229228
nMaxFeeler = connOptions.nMaxFeeler;
230229
m_max_outbound = m_max_outbound_full_relay + m_max_outbound_block_relay + nMaxFeeler;
231-
nBestHeight = connOptions.nBestHeight;
232230
clientInterface = connOptions.uiInterface;
233231
m_banman = connOptions.m_banman;
234232
m_msgproc = connOptions.m_msgproc;
@@ -382,9 +380,6 @@ class CConnman
382380
uint64_t GetTotalBytesRecv();
383381
uint64_t GetTotalBytesSent();
384382

385-
void SetBestHeight(int height);
386-
int GetBestHeight() const;
387-
388383
/** Get a unique deterministic randomizer. */
389384
CSipHasher GetDeterministicRandomizer(uint64_t id) const;
390385

@@ -559,7 +554,6 @@ class CConnman
559554
int nMaxFeeler;
560555
int m_max_outbound;
561556
bool m_use_addrman_outgoing;
562-
std::atomic<int> nBestHeight;
563557
CClientUIInterface* clientInterface;
564558
NetEventsInterface* m_msgproc;
565559
/** Pointer to this node's banman. May be nullptr - check existence before dereferencing. */
@@ -1056,7 +1050,7 @@ class CNode
10561050
// Whether a ping is requested.
10571051
std::atomic<bool> fPingQueued{false};
10581052

1059-
CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn, ConnectionType conn_type_in, bool inbound_onion = false);
1053+
CNode(NodeId id, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress& addrBindIn, const std::string& addrNameIn, ConnectionType conn_type_in, bool inbound_onion = false);
10601054
~CNode();
10611055
CNode(const CNode&) = delete;
10621056
CNode& operator=(const CNode&) = delete;
@@ -1084,7 +1078,6 @@ class CNode
10841078
//! service advertisements.
10851079
const ServiceFlags nLocalServices;
10861080

1087-
const int nMyStartingHeight;
10881081
NetPermissionFlags m_permissionFlags{ PF_NONE };
10891082
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
10901083

@@ -1108,10 +1101,6 @@ class CNode
11081101
return nLocalHostNonce;
11091102
}
11101103

1111-
int GetMyStartingHeight() const {
1112-
return nMyStartingHeight;
1113-
}
1114-
11151104
int GetRefCount() const
11161105
{
11171106
assert(nRefCount >= 0);

src/net_processing.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ void PeerManager::PushNodeVersion(CNode& pnode, int64_t nTime)
690690
// peer.
691691
ServiceFlags nLocalNodeServices = pnode.GetLocalServices();
692692
uint64_t nonce = pnode.GetLocalNonce();
693-
int nNodeStartingHeight = pnode.GetMyStartingHeight();
693+
const int nNodeStartingHeight{m_best_height};
694694
NodeId nodeid = pnode.GetId();
695695
CAddress addr = pnode.addr;
696696

@@ -1294,8 +1294,9 @@ void PeerManager::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_
12941294
* Update our best height and announce any block hashes which weren't previously
12951295
* in ::ChainActive() to our peers.
12961296
*/
1297-
void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
1298-
m_connman.SetBestHeight(pindexNew->nHeight);
1297+
void PeerManager::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
1298+
{
1299+
m_best_height = pindexNew->nHeight;
12991300
SetServiceFlagsIBDCache(!fInitialDownload);
13001301

13011302
// Don't relay inventory during initial block download.

src/net_processing.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,11 @@ class PeerManager final : public CValidationInterface, public NetEventsInterface
160160
/** Get statistics from node state */
161161
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats);
162162

163+
/** Set the best height */
164+
void SetBestHeight(int height) { m_best_height = height; };
165+
163166
/** Whether this node ignores txs received over p2p. */
164-
bool IgnoresIncomingTxs() {return m_ignore_incoming_txs;};
167+
bool IgnoresIncomingTxs() { return m_ignore_incoming_txs; };
165168

166169
private:
167170
/** Get a shared pointer to the Peer object.
@@ -224,9 +227,12 @@ class PeerManager final : public CValidationInterface, public NetEventsInterface
224227
CTxMemPool& m_mempool;
225228
TxRequestTracker m_txrequest GUARDED_BY(::cs_main);
226229

230+
/** The height of the best chain */
231+
std::atomic<int> m_best_height{-1};
232+
227233
int64_t m_stale_tip_check_time; //!< Next time to check for stale tip
228234

229-
//* Whether this node is running in blocks only mode */
235+
/** Whether this node is running in blocks only mode */
230236
const bool m_ignore_incoming_txs;
231237

232238
/** Whether we've completed initial sync yet, for determining when to turn

src/test/denialofservice_tests.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
8585

8686
// Mock an outbound peer
8787
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
88-
CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY);
88+
CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY);
8989
dummyNode1.SetCommonVersion(PROTOCOL_VERSION);
9090

9191
peerLogic->InitializeNode(&dummyNode1);
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
136136
static void AddRandomOutboundPeer(std::vector<CNode *> &vNodes, PeerManager &peerLogic, CConnmanTest* connman)
137137
{
138138
CAddress addr(ip(g_insecure_rand_ctx.randbits(32)), NODE_NONE);
139-
vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), 0, INVALID_SOCKET, addr, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY));
139+
vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), INVALID_SOCKET, addr, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY));
140140
CNode &node = *vNodes.back();
141141
node.SetCommonVersion(PROTOCOL_VERSION);
142142

@@ -229,7 +229,7 @@ BOOST_AUTO_TEST_CASE(peer_discouragement)
229229

230230
banman->ClearBanned();
231231
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
232-
CNode dummyNode1(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::INBOUND);
232+
CNode dummyNode1(id++, NODE_NETWORK, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::INBOUND);
233233
dummyNode1.SetCommonVersion(PROTOCOL_VERSION);
234234
peerLogic->InitializeNode(&dummyNode1);
235235
dummyNode1.fSuccessfullyConnected = true;
@@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE(peer_discouragement)
242242
BOOST_CHECK(!banman->IsDiscouraged(ip(0xa0b0c001|0x0000ff00))); // Different IP, not discouraged
243243

244244
CAddress addr2(ip(0xa0b0c002), NODE_NONE);
245-
CNode dummyNode2(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr2, 1, 1, CAddress(), "", ConnectionType::INBOUND);
245+
CNode dummyNode2(id++, NODE_NETWORK, INVALID_SOCKET, addr2, 1, 1, CAddress(), "", ConnectionType::INBOUND);
246246
dummyNode2.SetCommonVersion(PROTOCOL_VERSION);
247247
peerLogic->InitializeNode(&dummyNode2);
248248
dummyNode2.fSuccessfullyConnected = true;
@@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE(DoS_bantime)
279279
SetMockTime(nStartTime); // Overrides future calls to GetTime()
280280

281281
CAddress addr(ip(0xa0b0c001), NODE_NONE);
282-
CNode dummyNode(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr, 4, 4, CAddress(), "", ConnectionType::INBOUND);
282+
CNode dummyNode(id++, NODE_NETWORK, INVALID_SOCKET, addr, 4, 4, CAddress(), "", ConnectionType::INBOUND);
283283
dummyNode.SetCommonVersion(PROTOCOL_VERSION);
284284
peerLogic->InitializeNode(&dummyNode);
285285
dummyNode.fSuccessfullyConnected = true;

src/test/fuzz/connman.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ FUZZ_TARGET_INIT(connman, initialize_connman)
3232
CSubNet random_subnet;
3333
std::string random_string;
3434
while (fuzzed_data_provider.ConsumeBool()) {
35-
switch (fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 28)) {
35+
switch (fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 27)) {
3636
case 0:
3737
random_address = ConsumeAddress(fuzzed_data_provider);
3838
break;
@@ -125,21 +125,17 @@ FUZZ_TARGET_INIT(connman, initialize_connman)
125125
break;
126126
}
127127
case 25:
128-
connman.SetBestHeight(fuzzed_data_provider.ConsumeIntegral<int>());
129-
break;
130-
case 26:
131128
connman.SetNetworkActive(fuzzed_data_provider.ConsumeBool());
132129
break;
133-
case 27:
130+
case 26:
134131
connman.SetServices(random_service, static_cast<ServiceFlags>(fuzzed_data_provider.ConsumeIntegral<uint64_t>()));
135132
break;
136-
case 28:
133+
case 27:
137134
connman.SetTryNewOutboundPeer(fuzzed_data_provider.ConsumeBool());
138135
break;
139136
}
140137
}
141138
(void)connman.GetAddedNodeInfo();
142-
(void)connman.GetBestHeight();
143139
(void)connman.GetExtraFullOutboundCount();
144140
(void)connman.GetLocalServices();
145141
(void)connman.GetMaxOutboundTarget();

src/test/fuzz/net.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ FUZZ_TARGET_INIT(net, initialize_net)
117117
(void)node.GetId();
118118
(void)node.GetLocalNonce();
119119
(void)node.GetLocalServices();
120-
(void)node.GetMyStartingHeight();
121120
const int ref_count = node.GetRefCount();
122121
assert(ref_count >= 0);
123122
(void)node.GetCommonVersion();

src/test/fuzz/process_message.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void fuzz_target(const std::vector<uint8_t>& buffer, const std::string& LIMIT_TO
6464
const bool jump_out_of_ibd{fuzzed_data_provider.ConsumeBool()};
6565
if (jump_out_of_ibd) chainstate.JumpOutOfIbd();
6666
CDataStream random_bytes_data_stream{fuzzed_data_provider.ConsumeRemainingBytes<unsigned char>(), SER_NETWORK, PROTOCOL_VERSION};
67-
CNode& p2p_node = *MakeUnique<CNode>(0, ServiceFlags(NODE_NETWORK | NODE_WITNESS | NODE_BLOOM), 0, INVALID_SOCKET, CAddress{CService{in_addr{0x0100007f}, 7777}, NODE_NETWORK}, 0, 0, CAddress{}, std::string{}, ConnectionType::OUTBOUND_FULL_RELAY).release();
67+
CNode& p2p_node = *MakeUnique<CNode>(0, ServiceFlags(NODE_NETWORK | NODE_WITNESS | NODE_BLOOM), INVALID_SOCKET, CAddress{CService{in_addr{0x0100007f}, 7777}, NODE_NETWORK}, 0, 0, CAddress{}, std::string{}, ConnectionType::OUTBOUND_FULL_RELAY).release();
6868
p2p_node.fSuccessfullyConnected = true;
6969
p2p_node.nVersion = PROTOCOL_VERSION;
7070
p2p_node.SetCommonVersion(PROTOCOL_VERSION);

src/test/fuzz/process_messages.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ FUZZ_TARGET_INIT(process_messages, initialize_process_messages)
4949
for (int i = 0; i < num_peers_to_add; ++i) {
5050
const ServiceFlags service_flags = ServiceFlags(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
5151
const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray({ConnectionType::INBOUND, ConnectionType::OUTBOUND_FULL_RELAY, ConnectionType::MANUAL, ConnectionType::FEELER, ConnectionType::BLOCK_RELAY, ConnectionType::ADDR_FETCH});
52-
peers.push_back(MakeUnique<CNode>(i, service_flags, 0, INVALID_SOCKET, CAddress{CService{in_addr{0x0100007f}, 7777}, NODE_NETWORK}, 0, 0, CAddress{}, std::string{}, conn_type).release());
52+
peers.push_back(MakeUnique<CNode>(i, service_flags, INVALID_SOCKET, CAddress{CService{in_addr{0x0100007f}, 7777}, NODE_NETWORK}, 0, 0, CAddress{}, std::string{}, conn_type).release());
5353
CNode& p2p_node = *peers.back();
5454

5555
p2p_node.fSuccessfullyConnected = true;

src/test/fuzz/util.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ inline CNode ConsumeNode(FuzzedDataProvider& fuzzed_data_provider) noexcept
290290
{
291291
const NodeId node_id = fuzzed_data_provider.ConsumeIntegral<NodeId>();
292292
const ServiceFlags local_services = static_cast<ServiceFlags>(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
293-
const int my_starting_height = fuzzed_data_provider.ConsumeIntegral<int>();
294293
const SOCKET socket = INVALID_SOCKET;
295294
const CAddress address = ConsumeAddress(fuzzed_data_provider);
296295
const uint64_t keyed_net_group = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
@@ -299,7 +298,7 @@ inline CNode ConsumeNode(FuzzedDataProvider& fuzzed_data_provider) noexcept
299298
const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
300299
const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray({ConnectionType::INBOUND, ConnectionType::OUTBOUND_FULL_RELAY, ConnectionType::MANUAL, ConnectionType::FEELER, ConnectionType::BLOCK_RELAY, ConnectionType::ADDR_FETCH});
301300
const bool inbound_onion{conn_type == ConnectionType::INBOUND ? fuzzed_data_provider.ConsumeBool() : false};
302-
return {node_id, local_services, my_starting_height, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, conn_type, inbound_onion};
301+
return {node_id, local_services, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, conn_type, inbound_onion};
303302
}
304303

305304
inline void InitializeFuzzingContext(const std::string& chain_name = CBaseChainParams::REGTEST)

src/test/net_tests.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test)
181181
{
182182
SOCKET hSocket = INVALID_SOCKET;
183183
NodeId id = 0;
184-
int height = 0;
185184

186185
in_addr ipv4Addr;
187186
ipv4Addr.s_addr = 0xa0b0c001;
@@ -190,7 +189,7 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test)
190189
std::string pszDest;
191190

192191
std::unique_ptr<CNode> pnode1 = MakeUnique<CNode>(
193-
id++, NODE_NETWORK, height, hSocket, addr,
192+
id++, NODE_NETWORK, hSocket, addr,
194193
/* nKeyedNetGroupIn = */ 0,
195194
/* nLocalHostNonceIn = */ 0,
196195
CAddress(), pszDest, ConnectionType::OUTBOUND_FULL_RELAY);
@@ -204,7 +203,7 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test)
204203
BOOST_CHECK_EQUAL(pnode1->ConnectedThroughNetwork(), Network::NET_IPV4);
205204

206205
std::unique_ptr<CNode> pnode2 = MakeUnique<CNode>(
207-
id++, NODE_NETWORK, height, hSocket, addr,
206+
id++, NODE_NETWORK, hSocket, addr,
208207
/* nKeyedNetGroupIn = */ 1,
209208
/* nLocalHostNonceIn = */ 1,
210209
CAddress(), pszDest, ConnectionType::INBOUND,
@@ -219,7 +218,7 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test)
219218
BOOST_CHECK_EQUAL(pnode2->ConnectedThroughNetwork(), Network::NET_IPV4);
220219

221220
std::unique_ptr<CNode> pnode3 = MakeUnique<CNode>(
222-
id++, NODE_NETWORK, height, hSocket, addr,
221+
id++, NODE_NETWORK, hSocket, addr,
223222
/* nKeyedNetGroupIn = */ 0,
224223
/* nLocalHostNonceIn = */ 0,
225224
CAddress(), pszDest, ConnectionType::OUTBOUND_FULL_RELAY,
@@ -234,7 +233,7 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test)
234233
BOOST_CHECK_EQUAL(pnode3->ConnectedThroughNetwork(), Network::NET_IPV4);
235234

236235
std::unique_ptr<CNode> pnode4 = MakeUnique<CNode>(
237-
id++, NODE_NETWORK, height, hSocket, addr,
236+
id++, NODE_NETWORK, hSocket, addr,
238237
/* nKeyedNetGroupIn = */ 1,
239238
/* nLocalHostNonceIn = */ 1,
240239
CAddress(), pszDest, ConnectionType::INBOUND,
@@ -680,7 +679,7 @@ BOOST_AUTO_TEST_CASE(ipv4_peer_with_ipv6_addrMe_test)
680679
in_addr ipv4AddrPeer;
681680
ipv4AddrPeer.s_addr = 0xa0b0c001;
682681
CAddress addr = CAddress(CService(ipv4AddrPeer, 7777), NODE_NETWORK);
683-
std::unique_ptr<CNode> pnode = MakeUnique<CNode>(0, NODE_NETWORK, 0, INVALID_SOCKET, addr, 0, 0, CAddress{}, std::string{}, ConnectionType::OUTBOUND_FULL_RELAY);
682+
std::unique_ptr<CNode> pnode = MakeUnique<CNode>(0, NODE_NETWORK, INVALID_SOCKET, addr, 0, 0, CAddress{}, std::string{}, ConnectionType::OUTBOUND_FULL_RELAY);
684683
pnode->fSuccessfullyConnected.store(true);
685684

686685
// the peer claims to be reaching us via IPv6

0 commit comments

Comments
 (0)