aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/util.h
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-11-19 10:43:00 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2020-11-19 17:21:55 +0000
commit17a5f172fa9ec509b1c3f950ee8dfb6f025534d2 (patch)
tree084e4fafaa6c1672c3f91d95c91b2d96f3e2ef01 /src/test/fuzz/util.h
parent3457054c61d5b74800797e2c26a8126a21352382 (diff)
fuzz: Make addrman fuzzing harness deterministic
Diffstat (limited to 'src/test/fuzz/util.h')
-rw-r--r--src/test/fuzz/util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h
index e99ed8d72d..452651d93f 100644
--- a/src/test/fuzz/util.h
+++ b/src/test/fuzz/util.h
@@ -98,7 +98,8 @@ NODISCARD inline CAmount ConsumeMoney(FuzzedDataProvider& fuzzed_data_provider)
NODISCARD inline int64_t ConsumeTime(FuzzedDataProvider& fuzzed_data_provider) noexcept
{
- static const int64_t time_min = ParseISO8601DateTime("1970-01-01T00:00:00Z");
+ // Avoid t=0 (1970-01-01T00:00:00Z) since SetMockTime(0) is a no-op.
+ static const int64_t time_min = ParseISO8601DateTime("1970-01-01T00:00:01Z");
static const int64_t time_max = ParseISO8601DateTime("9999-12-31T23:59:59Z");
return fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(time_min, time_max);
}