From: Gavin Andresen Date: Mon, 19 Dec 2011 15:25:16 +0000 (-0800) Subject: Merge pull request #707 from gavinandresen/BIP14 X-Git-Tag: v0.4.0-unstable~129^2~316 X-Git-Url: https://git.novaco.in/?a=commitdiff_plain;h=1f3bc1c2399fb53eb1b2222194332aca07a31a36;hp=-c;p=novacoin.git Merge pull request #707 from gavinandresen/BIP14 Implement BIP 14 : separate protocol version from client version --- 1f3bc1c2399fb53eb1b2222194332aca07a31a36 diff --combined src/net.cpp index 50d2891,e20de98..7d2f18b --- a/src/net.cpp +++ b/src/net.cpp @@@ -727,6 -727,21 +727,21 @@@ void CNode::Cleanup( } + 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()), nBestHeight); + } + + + + + std::map CNode::setBanned; CCriticalSection CNode::cs_setBanned; @@@ -1225,8 -1240,6 +1240,8 @@@ void MapPort(bool /* unused fMapPort */ static const char *strDNSSeed[] = { "bitseed.xf2.org", "dnsseed.bluematt.me", + "seed.bitcoin.sipa.be", + "dnsseed.bitcoin.dashjr.org", }; void ThreadDNSAddressSeed(void* parg) diff --combined src/util.h index 7b7eaf6,f5357b7..d9a0841 --- a/src/util.h +++ b/src/util.h @@@ -183,6 -183,7 +183,6 @@@ std::string DecodeBase64(const std::str std::string EncodeBase64(const unsigned char* pch, size_t len); std::string EncodeBase64(const std::string& str); void ParseParameters(int argc, char* argv[]); -const char* wxGetTranslation(const char* psz); bool WildcardMatch(const char* psz, const char* mask); bool WildcardMatch(const std::string& str, const std::string& mask); int GetFilesize(FILE* file); @@@ -204,7 -205,7 +204,7 @@@ void SetMockTime(int64 nMockTimeIn) int64 GetAdjustedTime(); void AddTimeData(unsigned int ip, int64 nTime); std::string FormatFullVersion(); - + std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); @@@ -558,7 -559,7 +558,7 @@@ inline uint256 Hash(const T1 p1begin, c } template - uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=VERSION) + uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION) { // Most of the time is spent allocating and deallocating CDataStream's // buffer. If this ever needs to be optimized further, make a CStaticStream