Skip to content

Commit 083f203

Browse files
committed
Remove fNetworkNode.
Matt pointed out to me that this appeared to be doing nothing (except involving itself in data races).
1 parent 76fec09 commit 083f203

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5242,8 +5242,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
52425242
{
52435243
pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
52445244

5245-
// Mark this node as currently connected, so we update its timestamp later.
5246-
if (pfrom->fNetworkNode) {
5245+
if (!pfrom->fInbound) {
5246+
// Mark this node as currently connected, so we update its timestamp later.
52475247
LOCK(cs_main);
52485248
State(pfrom->GetId())->fCurrentlyConnected = true;
52495249
}

src/net.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,7 @@ void CConnman::ThreadSocketHandler()
10671067
pnode->CloseSocketDisconnect();
10681068

10691069
// hold in disconnected pool until all refs are released
1070-
if (pnode->fNetworkNode || pnode->fInbound)
1071-
pnode->Release();
1070+
pnode->Release();
10721071
vNodesDisconnected.push_back(pnode);
10731072
}
10741073
}
@@ -1808,7 +1807,6 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
18081807
return false;
18091808
if (grantOutbound)
18101809
grantOutbound->MoveTo(pnode->grantOutbound);
1811-
pnode->fNetworkNode = true;
18121810
if (fOneShot)
18131811
pnode->fOneShot = true;
18141812
if (fFeeler)
@@ -2531,7 +2529,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
25312529
fOneShot = false;
25322530
fClient = false; // set by version message
25332531
fFeeler = false;
2534-
fNetworkNode = false;
25352532
fSuccessfullyConnected = false;
25362533
fDisconnect = false;
25372534
nRefCount = 0;

src/net.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ class CNode
613613
bool fOneShot;
614614
bool fClient;
615615
const bool fInbound;
616-
bool fNetworkNode;
617616
bool fSuccessfullyConnected;
618617
bool fDisconnect;
619618
// We use fRelayTxes for two purposes -

0 commit comments

Comments
 (0)