diff options
| author | Gavin Andresen <[email protected]> | 2011-12-19 07:25:16 -0800 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-12-19 07:25:16 -0800 |
| commit | 1f3bc1c2399fb53eb1b2222194332aca07a31a36 (patch) | |
| tree | e7afd7d6d4b892af685985f75d5b3d7b5c2330be /src/util.cpp | |
| parent | Merge pull request #709 from luke-jr/newdnsseeds (diff) | |
| parent | Implement BIP 14 : separate protocol version from client version (diff) | |
| download | discoin-1f3bc1c2399fb53eb1b2222194332aca07a31a36.tar.xz discoin-1f3bc1c2399fb53eb1b2222194332aca07a31a36.zip | |
Merge pull request #707 from gavinandresen/BIP14
Implement BIP 14 : separate protocol version from client version
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp index 236c7f7c4..ef276e510 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4,6 +4,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "strlcpy.h" +#include <boost/algorithm/string/join.hpp> #include <boost/program_options/detail/config_file.hpp> #include <boost/program_options/parsers.hpp> #include <boost/filesystem.hpp> @@ -1001,7 +1002,7 @@ string FormatVersion(int nVersion) string FormatFullVersion() { - string s = FormatVersion(VERSION) + pszSubVer; + string s = FormatVersion(CLIENT_VERSION); if (VERSION_IS_BETA) { s += "-"; s += _("beta"); @@ -1009,6 +1010,17 @@ string FormatFullVersion() return s; } +// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014) +std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments) +{ + std::ostringstream ss; + ss << "/"; + ss << name << ":" << FormatVersion(nClientVersion); + if (!comments.empty()) + ss << "(" << boost::algorithm::join(comments, "; ") << ")"; + ss << "/"; + return ss.str(); +} |