diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2021-02-12 10:23:45 -0800 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2021-02-16 12:23:00 -0800 |
commit | 47a7a1687d276bfa8769dee4bb78e8725f67a50e (patch) | |
tree | d46255108b13e0e5ec1bece599946dcdfe1fa92b /src/util/time.cpp | |
parent | df6a5fc1dff3b1b7c2f2b67aad1ff17cac99f7b6 (diff) | |
download | bitcoin-47a7a1687d276bfa8769dee4bb78e8725f67a50e.tar.xz |
[util] Introduce a SetMockTime that takes chrono time
Diffstat (limited to 'src/util/time.cpp')
-rw-r--r-- | src/util/time.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/time.cpp b/src/util/time.cpp index 2589ec12a0..7b0eb8fd8e 100644 --- a/src/util/time.cpp +++ b/src/util/time.cpp @@ -53,6 +53,11 @@ void SetMockTime(int64_t nMockTimeIn) nMockTime.store(nMockTimeIn, std::memory_order_relaxed); } +void SetMockTime(std::chrono::seconds mock_time_in) +{ + nMockTime.store(mock_time_in.count(), std::memory_order_relaxed); +} + std::chrono::seconds GetMockTime() { return std::chrono::seconds(nMockTime.load(std::memory_order_relaxed)); |