Make BufferedFile to be a CAutoFile wrapper

This refactor allows to forward some calls to the underlying CAutoFile,
instead of re-implementing the logic in the buffered file.
This commit is contained in:
MarcoFalke
2023-07-04 17:09:13 +02:00
parent fa389d902f
commit 9999b89cd3
9 changed files with 23 additions and 27 deletions

View File

@@ -1020,7 +1020,7 @@ void ImportBlocks(ChainstateManager& chainman, std::vector<fs::path> vImportFile
break; // This error is logged in OpenBlockFile
}
LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile);
chainman.LoadExternalBlockFile(file.Get(), &pos, &blocks_with_unknown_parent);
chainman.LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
if (chainman.m_interrupt) {
LogPrintf("Interrupt requested. Exit %s\n", __func__);
return;
@@ -1039,7 +1039,7 @@ void ImportBlocks(ChainstateManager& chainman, std::vector<fs::path> vImportFile
CAutoFile file{fsbridge::fopen(path, "rb"), CLIENT_VERSION};
if (!file.IsNull()) {
LogPrintf("Importing blocks file %s...\n", fs::PathToString(path));
chainman.LoadExternalBlockFile(file.Get());
chainman.LoadExternalBlockFile(file);
if (chainman.m_interrupt) {
LogPrintf("Interrupt requested. Exit %s\n", __func__);
return;