diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-07-26 23:43:01 +0300 |
---|---|---|
committer | Larry Ruane <larryruane@gmail.com> | 2022-07-18 12:06:14 -0600 |
commit | dd065dae9fcebd6806ff67703ffa8128e80b97cc (patch) | |
tree | f747322a5ac69c6c4c98b142632e302938c71227 /src/test/fuzz/load_external_block_file.cpp | |
parent | f002f8a0e76bd5abd60ef6809b1ff2b4c2d56071 (diff) |
refactor: Make mapBlocksUnknownParent local, and rename it
Co-authored-by: Larry Ruane <larryruane@gmail.com>
Diffstat (limited to 'src/test/fuzz/load_external_block_file.cpp')
-rw-r--r-- | src/test/fuzz/load_external_block_file.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/test/fuzz/load_external_block_file.cpp b/src/test/fuzz/load_external_block_file.cpp index bfa977520b..f4b7dc08fd 100644 --- a/src/test/fuzz/load_external_block_file.cpp +++ b/src/test/fuzz/load_external_block_file.cpp @@ -31,6 +31,13 @@ FUZZ_TARGET_INIT(load_external_block_file, initialize_load_external_block_file) if (fuzzed_block_file == nullptr) { return; } - FlatFilePos flat_file_pos; - g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile(fuzzed_block_file, fuzzed_data_provider.ConsumeBool() ? &flat_file_pos : nullptr); + if (fuzzed_data_provider.ConsumeBool()) { + // Corresponds to the -reindex case (track orphan blocks across files). + FlatFilePos flat_file_pos; + std::multimap<uint256, FlatFilePos> blocks_with_unknown_parent; + g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile(fuzzed_block_file, &flat_file_pos, &blocks_with_unknown_parent); + } else { + // Corresponds to the -loadblock= case (orphan blocks aren't tracked across files). + g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile(fuzzed_block_file); + } } |