Major updates integration from all upstreams
This commit is contained in:
17
src/net.cpp
17
src/net.cpp
@@ -76,6 +76,7 @@ static std::vector<ListenSocket> vhListenSocket;
|
||||
CAddrMan addrman;
|
||||
int nMaxConnections = DEFAULT_MAX_PEER_CONNECTIONS;
|
||||
bool fAddressesInitialized = false;
|
||||
std::string strSubVersion;
|
||||
|
||||
vector<CNode*> vNodes;
|
||||
CCriticalSection cs_vNodes;
|
||||
@@ -85,10 +86,10 @@ CCriticalSection cs_mapRelay;
|
||||
limitedmap<CInv, int64_t> mapAlreadyAskedFor(MAX_INV_SZ);
|
||||
|
||||
static deque<string> vOneShots;
|
||||
CCriticalSection cs_vOneShots;
|
||||
static CCriticalSection cs_vOneShots;
|
||||
|
||||
set<CNetAddr> setservAddNodeAddresses;
|
||||
CCriticalSection cs_setservAddNodeAddresses;
|
||||
static set<CNetAddr> setservAddNodeAddresses;
|
||||
static CCriticalSection cs_setservAddNodeAddresses;
|
||||
|
||||
vector<std::string> vAddedNodes;
|
||||
CCriticalSection cs_vAddedNodes;
|
||||
@@ -97,7 +98,7 @@ NodeId nLastNodeId = 0;
|
||||
CCriticalSection cs_nLastNodeId;
|
||||
|
||||
static CSemaphore *semOutbound = NULL;
|
||||
boost::condition_variable messageHandlerCondition;
|
||||
static boost::condition_variable messageHandlerCondition;
|
||||
|
||||
// Signals for message handling
|
||||
static CNodeSignals g_signals;
|
||||
@@ -439,7 +440,7 @@ void CNode::PushVersion()
|
||||
else
|
||||
LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id);
|
||||
PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe,
|
||||
nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>()), nBestHeight, true);
|
||||
nLocalHostNonce, strSubVersion, nBestHeight, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -823,7 +824,7 @@ static bool AttemptToEvictConnection(bool fPreferNewConnection) {
|
||||
}
|
||||
|
||||
const Consensus::Params& params = Params().GetConsensus();
|
||||
int nActivationHeight = params.vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight;
|
||||
int nActivationHeight = params.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight;
|
||||
|
||||
if (nActivationHeight > 0 &&
|
||||
height < nActivationHeight &&
|
||||
@@ -831,7 +832,7 @@ static bool AttemptToEvictConnection(bool fPreferNewConnection) {
|
||||
{
|
||||
// Find any nodes which don't support Overwinter protocol version
|
||||
BOOST_FOREACH(const CNodeRef &node, vEvictionCandidates) {
|
||||
if (node->nVersion < params.vUpgrades[Consensus::UPGRADE_OVERWINTER].nProtocolVersion) {
|
||||
if (node->nVersion < params.vUpgrades[Consensus::UPGRADE_SAPLING].nProtocolVersion) {
|
||||
vTmpEvictionCandidates.push_back(node);
|
||||
}
|
||||
}
|
||||
@@ -1819,7 +1820,7 @@ bool StopNode()
|
||||
return true;
|
||||
}
|
||||
|
||||
class CNetCleanup
|
||||
static class CNetCleanup
|
||||
{
|
||||
public:
|
||||
CNetCleanup() {}
|
||||
|
||||
Reference in New Issue
Block a user