aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-11-30 17:13:00 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-11-30 17:15:58 -0800
commit3bf06e9bac57b5b5a746677b75e297a7b154bdbd (patch)
tree2d1a02dd11ed52e3d698776e7673b58c08df2d78
parent72ae6f8cf0224370e8121d6769b21e612ca15d6f (diff)
parentbdb922b34c9a477c4ebf358653f6bcfb9bee48ce (diff)
downloadbitcoin-3bf06e9bac57b5b5a746677b75e297a7b154bdbd.tar.xz
Merge #9226: Remove fNetworkNode and pnodeLocalHost.
bdb922b Remove pnodeLocalHost. (Gregory Maxwell) 083f203 Remove fNetworkNode. (Gregory Maxwell)
-rw-r--r--src/main.cpp4
-rw-r--r--src/net.cpp20
-rw-r--r--src/net.h1
3 files changed, 3 insertions, 22 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 452ceac568..274bf6fdda 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5242,8 +5242,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
{
pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
- // Mark this node as currently connected, so we update its timestamp later.
- if (pfrom->fNetworkNode) {
+ if (!pfrom->fInbound) {
+ // Mark this node as currently connected, so we update its timestamp later.
LOCK(cs_main);
State(pfrom->GetId())->fCurrentlyConnected = true;
}
diff --git a/src/net.cpp b/src/net.cpp
index ba74cd071e..27b200b3f0 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -74,7 +74,6 @@ bool fRelayTxes = true;
CCriticalSection cs_mapLocalHost;
std::map<CNetAddr, LocalServiceInfo> mapLocalHost;
static bool vfLimited[NET_MAX] = {};
-static CNode* pnodeLocalHost = NULL;
std::string strSubVersion;
limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ);
@@ -1067,8 +1066,7 @@ void CConnman::ThreadSocketHandler()
pnode->CloseSocketDisconnect();
// hold in disconnected pool until all refs are released
- if (pnode->fNetworkNode || pnode->fInbound)
- pnode->Release();
+ pnode->Release();
vNodesDisconnected.push_back(pnode);
}
}
@@ -1813,7 +1811,6 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
return false;
if (grantOutbound)
grantOutbound->MoveTo(pnode->grantOutbound);
- pnode->fNetworkNode = true;
if (fOneShot)
pnode->fOneShot = true;
if (fFeeler)
@@ -2144,17 +2141,6 @@ bool CConnman::Start(boost::thread_group& threadGroup, CScheduler& scheduler, st
semOutbound = new CSemaphore(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections));
}
- if (pnodeLocalHost == NULL) {
- CNetAddr local;
- LookupHost("127.0.0.1", local, false);
-
- NodeId id = GetNewNodeId();
- uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
-
- pnodeLocalHost = new CNode(id, nLocalServices, GetBestHeight(), INVALID_SOCKET, CAddress(CService(local, 0), nLocalServices), 0, nonce);
- GetNodeSignals().InitializeNode(pnodeLocalHost, *this);
- }
-
//
// Start threads
//
@@ -2232,9 +2218,6 @@ void CConnman::Stop()
vhListenSocket.clear();
delete semOutbound;
semOutbound = NULL;
- if(pnodeLocalHost)
- DeleteNode(pnodeLocalHost);
- pnodeLocalHost = NULL;
}
void CConnman::DeleteNode(CNode* pnode)
@@ -2536,7 +2519,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
fOneShot = false;
fClient = false; // set by version message
fFeeler = false;
- fNetworkNode = false;
fSuccessfullyConnected = false;
fDisconnect = false;
nRefCount = 0;
diff --git a/src/net.h b/src/net.h
index df3930d82e..a7c0ecf324 100644
--- a/src/net.h
+++ b/src/net.h
@@ -613,7 +613,6 @@ public:
bool fOneShot;
bool fClient;
const bool fInbound;
- bool fNetworkNode;
bool fSuccessfullyConnected;
std::atomic_bool fDisconnect;
// We use fRelayTxes for two purposes -