diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-08-21 16:11:09 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-08-26 13:25:22 +0200 |
| commit | ad49c256c33bfe4088fd3c7ecb7d28cb81a8fc70 (patch) | |
| tree | c4152c73cf6a424a882a125fa89c59ee6869bb86 /src/timedata.cpp | |
| parent | Move `COIN` and `CENT` to core.h (diff) | |
| download | discoin-ad49c256c33bfe4088fd3c7ecb7d28cb81a8fc70.tar.xz discoin-ad49c256c33bfe4088fd3c7ecb7d28cb81a8fc70.zip | |
Split up util.cpp/h
Split up util.cpp/h into:
- string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach)
- money utilities (parsesmoney, formatmoney)
- time utilities (gettime*, sleep, format date):
- and the rest (logging, argument parsing, config file parsing)
The latter is basically the environment and OS handling,
and is stripped of all utility functions, so we may want to
rename it to something else than util.cpp/h for clarity (Matt suggested
osinterface).
Breaks dependency of sha256.cpp on all the things pulled in by util.
Diffstat (limited to 'src/timedata.cpp')
| -rw-r--r-- | src/timedata.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timedata.cpp b/src/timedata.cpp index 4576786b9..40cdb33f7 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -8,6 +8,7 @@ #include "sync.h" #include "ui_interface.h" #include "util.h" +#include "utilstrencodings.h" #include <boost/foreach.hpp> @@ -35,6 +36,11 @@ int64_t GetAdjustedTime() return GetTime() + GetTimeOffset(); } +static int64_t abs64(int64_t n) +{ + return (n >= 0 ? n : -n); +} + void AddTimeData(const CNetAddr& ip, int64_t nTime) { int64_t nOffsetSample = nTime - GetTime(); |