mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge pull request #4978
938bcceCAutoFile: make file private (Philip Kaufmann)0c35486CBufferedFile: add explicit close function (Philip Kaufmann)c9fb27dCBufferedFile: convert into a non-refcounted RAII wrapper (Philip Kaufmann)
This commit is contained in:
@@ -3085,6 +3085,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
||||
|
||||
int nLoaded = 0;
|
||||
try {
|
||||
// This takes over fileIn and calls fclose() on it in the CBufferedFile destructor
|
||||
CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION);
|
||||
uint64_t nStartByte = 0;
|
||||
if (dbp) {
|
||||
@@ -3141,7 +3142,6 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
||||
LogPrintf("%s : Deserialize or I/O error - %s", __func__, e.what());
|
||||
}
|
||||
}
|
||||
fclose(fileIn);
|
||||
} catch(std::runtime_error &e) {
|
||||
AbortNode(_("Error: system error: ") + e.what());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user