diff options
| author | Gavin Andresen <[email protected]> | 2011-04-15 11:41:39 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-04-15 11:41:39 -0400 |
| commit | a381eb8ddbad0a6924b856d0025b79562077edfb (patch) | |
| tree | 1ee5157bac2be75d11325eff0336c42dea275051 /util.cpp | |
| parent | build: add note for Snow Leopard users and fix typos in linking instructions (diff) | |
| parent | Send/return full bitcoin version string in Server and User-Agent HTTP headers (diff) | |
| download | discoin-a381eb8ddbad0a6924b856d0025b79562077edfb.tar.xz discoin-a381eb8ddbad0a6924b856d0025b79562077edfb.zip | |
Merge branch 'http-version' of https://github.com/jgarzik/bitcoin
Diffstat (limited to 'util.cpp')
| -rw-r--r-- | util.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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; +} + + + + + |