aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-02-10 18:30:51 -0800
committerAmiti Uttarwar <amiti@uttarwar.org>2021-02-16 12:23:00 -0800
commitdf6a5fc1dff3b1b7c2f2b67aad1ff17cac99f7b6 (patch)
treeb1edc583b5a7304383570837f28bdd19d86b51ad /src/util
parenta2d908e1daa1d1be74568bd7d1d04b724da7d79c (diff)
downloadbitcoin-df6a5fc1dff3b1b7c2f2b67aad1ff17cac99f7b6.tar.xz
[util] Change GetMockTime to return chrono type instead of int
Diffstat (limited to 'src/util')
-rw-r--r--src/util/time.cpp4
-rw-r--r--src/util/time.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/util/time.cpp b/src/util/time.cpp
index 295806c54a..2589ec12a0 100644
--- a/src/util/time.cpp
+++ b/src/util/time.cpp
@@ -53,9 +53,9 @@ void SetMockTime(int64_t nMockTimeIn)
nMockTime.store(nMockTimeIn, std::memory_order_relaxed);
}
-int64_t GetMockTime()
+std::chrono::seconds GetMockTime()
{
- return nMockTime.load(std::memory_order_relaxed);
+ return std::chrono::seconds(nMockTime.load(std::memory_order_relaxed));
}
int64_t GetTimeMillis()
diff --git a/src/util/time.h b/src/util/time.h
index 03b75b5be5..38edc71de1 100644
--- a/src/util/time.h
+++ b/src/util/time.h
@@ -45,8 +45,9 @@ int64_t GetSystemTimeInSeconds(); // Like GetTime(), but not mockable
/** For testing. Set e.g. with the setmocktime rpc, or -mocktime argument */
void SetMockTime(int64_t nMockTimeIn);
+
/** For testing */
-int64_t GetMockTime();
+std::chrono::seconds GetMockTime();
/** Return system time (or mocked time, if set) */
template <typename T>