mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 03:03:58 +01:00
Move *Version() functions to version.h/cpp
This commit is contained in:
25
src/util.cpp
25
src/util.cpp
@@ -13,7 +13,6 @@
|
||||
#include "random.h"
|
||||
#include "sync.h"
|
||||
#include "uint256.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -1116,30 +1115,6 @@ void SetMockTime(int64_t nMockTimeIn)
|
||||
nMockTime = nMockTimeIn;
|
||||
}
|
||||
|
||||
string FormatVersion(int nVersion)
|
||||
{
|
||||
if (nVersion%100 == 0)
|
||||
return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
|
||||
else
|
||||
return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
|
||||
}
|
||||
|
||||
string FormatFullVersion()
|
||||
{
|
||||
return CLIENT_BUILD;
|
||||
}
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate)
|
||||
|
||||
Reference in New Issue
Block a user