| 24 | static std::atomic<int64_t> nMockTime(0); //!< For testing |
| 25 | |
| 26 | int64_t GetTime() |
| 27 | { |
| 28 | int64_t mocktime = nMockTime.load(std::memory_order_relaxed); |
| 29 | if (mocktime) return mocktime; |
| 30 | |
| 31 | time_t now = time(nullptr); |
| 32 | assert(now > 0); |
| 33 | return now; |
| 34 | } |
| 35 | |
| 36 | bool ChronoSanityCheck() |
| 37 | { |