Browse Source

Remove fNetworkNode.

Matt pointed out to me that this appeared to be doing nothing (except involving itself in data races).
0.14
Gregory Maxwell 8 years ago
parent
commit
083f203698
  1. 2
      src/main.cpp
  2. 3
      src/net.cpp
  3. 1
      src/net.h

2
src/main.cpp

@ -5242,8 +5242,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
{ {
pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION)); pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
if (!pfrom->fInbound) {
// Mark this node as currently connected, so we update its timestamp later. // Mark this node as currently connected, so we update its timestamp later.
if (pfrom->fNetworkNode) {
LOCK(cs_main); LOCK(cs_main);
State(pfrom->GetId())->fCurrentlyConnected = true; State(pfrom->GetId())->fCurrentlyConnected = true;
} }

3
src/net.cpp

@ -1067,7 +1067,6 @@ void CConnman::ThreadSocketHandler()
pnode->CloseSocketDisconnect(); pnode->CloseSocketDisconnect();
// hold in disconnected pool until all refs are released // hold in disconnected pool until all refs are released
if (pnode->fNetworkNode || pnode->fInbound)
pnode->Release(); pnode->Release();
vNodesDisconnected.push_back(pnode); vNodesDisconnected.push_back(pnode);
} }
@ -1808,7 +1807,6 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
return false; return false;
if (grantOutbound) if (grantOutbound)
grantOutbound->MoveTo(pnode->grantOutbound); grantOutbound->MoveTo(pnode->grantOutbound);
pnode->fNetworkNode = true;
if (fOneShot) if (fOneShot)
pnode->fOneShot = true; pnode->fOneShot = true;
if (fFeeler) if (fFeeler)
@ -2531,7 +2529,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
fOneShot = false; fOneShot = false;
fClient = false; // set by version message fClient = false; // set by version message
fFeeler = false; fFeeler = false;
fNetworkNode = false;
fSuccessfullyConnected = false; fSuccessfullyConnected = false;
fDisconnect = false; fDisconnect = false;
nRefCount = 0; nRefCount = 0;

1
src/net.h

@ -613,7 +613,6 @@ public:
bool fOneShot; bool fOneShot;
bool fClient; bool fClient;
const bool fInbound; const bool fInbound;
bool fNetworkNode;
bool fSuccessfullyConnected; bool fSuccessfullyConnected;
bool fDisconnect; bool fDisconnect;
// We use fRelayTxes for two purposes - // We use fRelayTxes for two purposes -

Loading…
Cancel
Save