mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
Merge #9226: Remove fNetworkNode and pnodeLocalHost.
bdb922b Remove pnodeLocalHost. (Gregory Maxwell) 083f203 Remove fNetworkNode. (Gregory Maxwell)
This commit is contained in:
commit
3bf06e9bac
@ -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;
|
||||
}
|
||||
|
20
src/net.cpp
20
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user