7 #include <chainparams.h>
11 #include <validation.h>
27 const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(
ChainType::MAIN)};
31 const fs::path blkfile{testing_setup.get()->m_path_root /
"blk.dat"};
33 auto params{testing_setup->m_node.chainman->GetParams()};
34 ss << params.MessageStart();
46 if (fwrite(ss.data(), 1, ss.size(), file) != ss.size()) {
47 throw std::runtime_error(
"write to test file failed\n");
53 std::multimap<uint256, FlatFilePos> blocks_with_unknown_parent;
59 testing_setup->m_node.chainman->LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
Double ended buffer combining vector and stream-like interfaces.
A Span is an object that can refer to a contiguous sequence of objects.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
static const int CLIENT_VERSION
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
BENCHMARK(LoadExternalBlockFile, benchmark::PriorityLevel::HIGH)
static void LoadExternalBlockFile(benchmark::Bench &bench)
The LoadExternalBlockFile() function is used during -reindex and -loadblock.
const std::vector< uint8_t > block413567
FILE * fopen(const fs::path &p, const char *mode)
static const unsigned int MAX_BLOCKFILE_SIZE
The maximum size of a blk?????.dat file (since 0.8)