fuzz: Use min option in ConsumeTime
This is less code and also required for the next commit.
This commit is contained in:
1 file changed
+1
-3
@@ -55,13 +55,11 @@ FUZZ_TARGET(headers_sync_state, .init = initialize_headers_sync_state_fuzz)
|
|||||||
{
|
{
|
||||||
SeedRandomStateForTest(SeedRand::ZEROS);
|
SeedRandomStateForTest(SeedRand::ZEROS);
|
||||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||||
auto mock_time{ConsumeTime(fuzzed_data_provider)};
|
|
||||||
|
|
||||||
CBlockHeader genesis_header{Params().GenesisBlock()};
|
CBlockHeader genesis_header{Params().GenesisBlock()};
|
||||||
CBlockIndex start_index(genesis_header);
|
CBlockIndex start_index(genesis_header);
|
||||||
|
|
||||||
if (mock_time < start_index.GetMedianTimePast()) return;
|
SetMockTime(ConsumeTime(fuzzed_data_provider, /*min=*/start_index.GetMedianTimePast()));
|
||||||
SetMockTime(mock_time);
|
|
||||||
|
|
||||||
const uint256 genesis_hash = genesis_header.GetHash();
|
const uint256 genesis_hash = genesis_header.GetHash();
|
||||||
start_index.phashBlock = &genesis_hash;
|
start_index.phashBlock = &genesis_hash;
|
||||||
|
|||||||
Reference in new issue
Block a user