diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-06-12 15:19:02 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-06-17 14:12:32 -0400 |
commit | fa883ab35ad2d4328e35b1e855d0833740a6b910 (patch) | |
tree | 4efff508a9e43e652f14f1d0df4b703f50cb7743 /src/random.cpp | |
parent | fce4123242c4ad76dabef1291306f5ba879cdc00 (diff) |
net: Use mockable time for tx download
Diffstat (limited to 'src/random.cpp')
-rw-r--r-- | src/random.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/random.cpp b/src/random.cpp index de26e6de1a..675b177af3 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -667,6 +667,11 @@ uint64_t GetRand(uint64_t nMax) noexcept return FastRandomContext(g_mock_deterministic_tests).randrange(nMax); } +std::chrono::microseconds GetRandMicros(std::chrono::microseconds duration_max) noexcept +{ + return std::chrono::microseconds{GetRand(duration_max.count())}; +} + int GetRandInt(int nMax) noexcept { return GetRand(nMax); |