aboutsummaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2011-04-15 03:58:28 -0400
committerJeff Garzik <jgarzik@pobox.com>2011-04-15 03:58:28 -0400
commita5843203574aba93a94df09eed9c922ec0f41d78 (patch)
treef8fb337c49ab85be2fa48eade2f788be34e85a2d /util.cpp
parentb37f09aa2e80b17028ad7fe1e87362c0f07c7406 (diff)
downloadbitcoin-a5843203574aba93a94df09eed9c922ec0f41d78.tar.xz
Ensure version number->string conversion is consistent
Diffstat (limited to 'util.cpp')
-rw-r--r--util.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/util.cpp b/util.cpp
index 655626dd3b..1c685ba42d 100644
--- a/util.cpp
+++ b/util.cpp
@@ -855,3 +855,32 @@ void AddTimeData(unsigned int ip, int64 nTime)
printf("| nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
}
}
+
+
+
+
+
+
+
+
+
+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()
+{
+ string s = FormatVersion(VERSION) + pszSubVer;
+ if (VERSION_IS_BETA)
+ s += _("-beta");
+ return s;
+}
+
+
+
+
+