diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-10-02 22:35:13 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-10-02 22:35:36 +0200 |
commit | 0e64566a829a2d6a59d83c7f6731f9849f6dbc90 (patch) | |
tree | 4a34019ab37c1c382fd4335a1e699c30c6ae3651 /src/main.cpp | |
parent | 6faee7942671141649b74e50908cb99cabc840e5 (diff) | |
parent | 938bccebf1cb3ed6c7b8bfb8236a5172433bf890 (diff) |
Merge pull request #4978
938bcce CAutoFile: make file private (Philip Kaufmann)
0c35486 CBufferedFile: add explicit close function (Philip Kaufmann)
c9fb27d CBufferedFile: convert into a non-refcounted RAII wrapper (Philip Kaufmann)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 55485c86ff..129d184868 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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()); } |