0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

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.
This commit is contained in:
MarcoFalke 2024-04-15 12:57:17 +02:00
parent 3abee5eceb
commit fa382d3dd0
No known key found for this signature in database

View file

@ -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);
}