mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
net: Use mockable time for tx download
This commit is contained in:
parent
fce4123242
commit
fa883ab35a
3 changed files with 42 additions and 32 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue