aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-04-15 12:57:17 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-04-15 13:34:27 +0200
commitfa382d3dd0592f3cbd6e1de791449f49e06dae86 (patch)
tree462040211ca17908b4b5636396ba8cdbc357e7e1
parent3abee5eceb4158ccf455aff9d1d76461dfff5af0 (diff)
test: Add missing Assert(mock_time_in >= 0s) to SetMockTime
Also, inline the deprecated alias to avoid having the two go out of sync again in the future.
-rw-r--r--src/util/time.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/util/time.cpp b/src/util/time.cpp
index 456662bd84..e46a127b14 100644
--- a/src/util/time.cpp
+++ b/src/util/time.cpp
@@ -29,14 +29,10 @@ NodeClock::time_point NodeClock::now() noexcept
return time_point{ret};
};
-void SetMockTime(int64_t nMockTimeIn)
-{
- Assert(nMockTimeIn >= 0);
- nMockTime.store(nMockTimeIn, std::memory_order_relaxed);
-}
-
+void SetMockTime(int64_t nMockTimeIn) { SetMockTime(std::chrono::seconds{nMockTimeIn}); }
void SetMockTime(std::chrono::seconds mock_time_in)
{
+ Assert(mock_time_in >= 0s);
nMockTime.store(mock_time_in.count(), std::memory_order_relaxed);
}