Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/load_external_block_file.cpp
Show All 31 Lines | FUZZ_TARGET_INIT(load_external_block_file, | ||||
if (fuzzed_block_file == nullptr) { | if (fuzzed_block_file == nullptr) { | ||||
return; | return; | ||||
} | } | ||||
if (fuzzed_data_provider.ConsumeBool()) { | if (fuzzed_data_provider.ConsumeBool()) { | ||||
// Corresponds to the -reindex case (track orphan blocks across files). | // Corresponds to the -reindex case (track orphan blocks across files). | ||||
FlatFilePos flat_file_pos; | FlatFilePos flat_file_pos; | ||||
std::multimap<BlockHash, FlatFilePos> blocks_with_unknown_parent; | std::multimap<BlockHash, FlatFilePos> blocks_with_unknown_parent; | ||||
g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile( | g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile( | ||||
GetConfig(), fuzzed_block_file, &flat_file_pos, | fuzzed_block_file, &flat_file_pos, &blocks_with_unknown_parent); | ||||
&blocks_with_unknown_parent); | |||||
} else { | } else { | ||||
// Corresponds to the -loadblock= case (orphan blocks aren't tracked | // Corresponds to the -loadblock= case (orphan blocks aren't tracked | ||||
// across files). | // across files). | ||||
g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile( | g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile( | ||||
GetConfig(), fuzzed_block_file); | fuzzed_block_file); | ||||
} | } | ||||
} | } |