else
pszColon[0] = 0;
port = portParsed;
- if (port < 0 || port > USHRT_MAX)
- port = USHRT_MAX;
+ if (port < 0 || port > std::numeric_limits<unsigned short>::max())
+ port = std::numeric_limits<unsigned short>::max();
}
}
}
+void CNode::PushVersion()
+{
+ /// when NTP implemented, change to just nTime = GetAdjustedTime()
+ int64 nTime = (fInbound ? GetAdjustedTime() : GetTime());
+ CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr);
+ CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost);
+ RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
+ PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe,
+ nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>()), nBestHeight);
+}
+
+
+
+
+
std::map<unsigned int, int64> CNode::setBanned;
CCriticalSection CNode::cs_setBanned;
// Choose an address to connect to based on most recently seen
//
CAddress addrConnect;
- int64 nBest = INT64_MIN;
+ int64 nBest = std::numeric_limits<int64>::min();
// Only connect to one address per a.b.?.? range.
// Do this here so we don't have to critsect vNodes inside mapAddresses critsect.