From 8686f6467c9db2606706baca33842c97ff7621f8 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Fri, 11 Jan 2013 06:11:34 -0500 Subject: Add timeoffset to getinfo RPC call Provides a method to get the difference between network adjusted time and local time from the RPC interface. --- src/util.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index 576ba50dbb..f1ddda20f1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1203,9 +1203,14 @@ void SetMockTime(int64 nMockTimeIn) static int64 nTimeOffset = 0; +int64 GetTimeOffset() +{ + return nTimeOffset; +} + int64 GetAdjustedTime() { - return GetTime() + nTimeOffset; + return GetTime() + GetTimeOffset(); } void AddTimeData(const CNetAddr& ip, int64 nTime) -- cgit v1.2.3