diff -uNr a/bitcoin/src/init.cpp b/bitcoin/src/init.cpp --- a/bitcoin/src/init.cpp ff7009f672bf400a42d1d7afb6e58aaf1c29d9c219fad51c5f17000243a485e92bbb250d3f4bbec3f0717d00fad620c294d537832671f20c0979fb3f1383779b +++ b/bitcoin/src/init.cpp 29fbb8792c3462ced61b4a0284360122f72c4fef7fb5fb84e5399967ab6474cd83ccf3a60eb3c425e183b1b95fb9ca71fc23bb791316d762034559df293f8bb0 @@ -175,6 +175,8 @@ " -debug \t\t " + _("Output extra debugging information\n") + " -caneat \t\t " + _("Permit the use of 'eatblock'\n") + " -verifyall \t\t " + _("Forbid the skipping of ECDSA signature verification between checkpoints.\n") + + " -setverstring \t\t " + _("Set a custom version string.\n") + + " -setvernum \t\t " + _("Set a custom version number.\n") + " -logtimestamps \t " + _("Prepend debug output with timestamp\n") + " -printtoconsole \t " + _("Send trace/debug info to console instead of debug.log file\n") + " -rpcuser= \t " + _("Username for JSON-RPC connections\n") + @@ -199,6 +201,16 @@ fCanEat = GetBoolArg("-caneat"); fVerifyAll = GetBoolArg("-verifyall"); + if (mapArgs.count("-setverstring")) + { + CLIENT_NAME = mapArgs["-setverstring"]; + } + + if (mapArgs.count("-setvernum")) + { + VERSION = atoi(mapArgs["-setvernum"]); + } + if (fDaemon) fServer = true; else diff -uNr a/bitcoin/src/knobs.h b/bitcoin/src/knobs.h --- a/bitcoin/src/knobs.h false +++ b/bitcoin/src/knobs.h 9b88b8f60d9a0ae98f9dd148dba06e132b6b1fc199719eacb3270fe6ce2af889422eee62c2cb08c3b93f22069aea880c657e771c4e4b4157a69c321550c8fc73 @@ -0,0 +1,7 @@ +#ifndef KNOBS_H +#define KNOBS_H + +#define DEFAULT_CLIENT_NAME "therealbitcoin.org" +#define DEFAULT_CLIENT_VERSION 99999 /* 50400 */ + +#endif diff -uNr a/bitcoin/src/makefile.unix b/bitcoin/src/makefile.unix --- a/bitcoin/src/makefile.unix 929157d5e139336f38e98555f14fc125c4217c23eba941086b648147e39fcec9ecab632567fc3295e58826fedf6239d5cc0cd028f4e78fd56ae868b795d2de02 +++ b/bitcoin/src/makefile.unix 09ac104678a444430d3ef0bdf6dbd07d875666493b2d938ac6aa7fb67abe840f2254f517055f4b5f90d0e86c83ee3dade77a58f1c37b7ab7b4c13598a5559adc @@ -81,6 +81,7 @@ init.h \ key.h \ keystore.h \ + knobs.h \ main.h \ net.h \ noui.h \ diff -uNr a/bitcoin/src/net.h b/bitcoin/src/net.h --- a/bitcoin/src/net.h d18800dfc6abc874cf8f8f3fdf9bbfa000b6611760c571ef64089894b3ac92303c8891aff55d66648d6b8c0033bfab31e40aa6562a0bc75e2a9c0950175a733b +++ b/bitcoin/src/net.h bb842420bcc67752edf8e658524b135f499c5f8676557a6c12f47f204303e34bd73beabdf6e9146ba452947c4e5cd298529969fab90f16942f6bf0c1229f7043 @@ -360,7 +360,7 @@ CAddress addrMe = (fUseProxy || !addrLocalHost.IsRoutable() ? CAddress("0.0.0.0") : addrLocalHost); RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe, - nLocalHostNonce, std::string(pszSubVer), nBestHeight); + nLocalHostNonce, FormatSubVersion(CLIENT_NAME, VERSION), nBestHeight); } diff -uNr a/bitcoin/src/serialize.h b/bitcoin/src/serialize.h --- a/bitcoin/src/serialize.h bc602bfbc512259fbb6c01f2c1633ff142966bf0752612e9a488cee8a95da7921b98abe646e2f7002243f1981939372e0b53948646398e40525ed442c377f449 +++ b/bitcoin/src/serialize.h 3b61e200efe4b17a7f5384e13ab2a1a5e0a74fce0a097802d5e32bb5d74f88fa6e018f56c36ca9198d726a3a78168f87a6181d498cb7a388bc1f3adefa7cd93f @@ -24,6 +24,9 @@ #include #include + +#include "knobs.h" + /* This comes from limits.h if it's not defined there set a sane default */ #ifndef PAGESIZE #include @@ -41,9 +44,7 @@ class CAutoFile; static const unsigned int MAX_SIZE = 0x02000000; -static const int VERSION = 50400; -static const char* pszSubVer = ""; -static const bool VERSION_IS_BETA = true; +static int VERSION = DEFAULT_CLIENT_VERSION; // Used to bypass the rule against non-const reference to temporary // where it makes sense with wrappers such as CFlatData or CTxDB diff -uNr a/bitcoin/src/util.cpp b/bitcoin/src/util.cpp --- a/bitcoin/src/util.cpp 3dcfe5f29728dcd34a6dfe23e9cd17e5f4a332a8d2e7444355106c8c63436cf54892424df2018756c2e109463fd87728fc668a5a03914a4aa3f30bb90403b433 +++ b/bitcoin/src/util.cpp 72641fcb9bce1f705246cf52f08b3ece4b8df65e07ca10a32db860d4a120532a911fc62549960ccfdfc020fd1a5ef8baf0fcf181b861e0903c65b044899fc008 @@ -2,6 +2,7 @@ // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. +#include "knobs.h" #include "headers.h" #include "strlcpy.h" #include @@ -32,7 +33,7 @@ bool fNoListen = false; bool fLogTimestamps = false; - +std::string CLIENT_NAME(DEFAULT_CLIENT_NAME); // Workaround for "multiple definition of `_tls_used'" @@ -889,14 +890,18 @@ string FormatFullVersion() { - string s = FormatVersion(VERSION) + pszSubVer; - if (VERSION_IS_BETA) { - s += "-"; - s += _("beta"); - } + string s = FormatVersion(VERSION); return s; } +std::string FormatSubVersion(const std::string& name, int nClientVersion) +{ + std::ostringstream ss; + ss << "/"; + ss << name << ":" << FormatVersion(nClientVersion); + ss << "/"; + return ss.str(); +} diff -uNr a/bitcoin/src/util.h b/bitcoin/src/util.h --- a/bitcoin/src/util.h 44bd62e864ed9400105aeea2e2ef6499f971577fd28b9c8dc52ef72dcdb4d4928168037cd7d7fca718e5d5a2d4d7c19c65f5b45c87d814d6e24c0d014b307477 +++ b/bitcoin/src/util.h d7e407108638c11f75b5bed04dc455ac78a96debc0776cd0e71871001c5886fd1472ae060e7a2334fcf3e323b7ad0a1b4fb68757392cc45a1b09721eb67415d1 @@ -121,6 +121,7 @@ extern std::string strMiscWarning; extern bool fNoListen; extern bool fLogTimestamps; +extern std::string CLIENT_NAME; void RandAddSeed(); void RandAddSeedPerfmon(); @@ -161,6 +162,7 @@ int64 GetAdjustedTime(); void AddTimeData(unsigned int ip, int64 nTime); std::string FormatFullVersion(); +std::string FormatSubVersion(const std::string& name, int nClientVersion);