mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
refactor: Drop unused fclose() from BufferedFile
This was only explicitly used in the tests, where it can be replaced by wrapping the original raw file pointer into a CAutoFile on creation and then calling CAutoFile::fclose(). Also, it was used in LoadExternalBlockFile(), where it can also be replaced by the (implicit call to the) CAutoFile destructor after wrapping the original raw file pointer in a CAutoFile.
This commit is contained in:
parent
f608a409f7
commit
fa389d902f
8 changed files with 42 additions and 57 deletions
|
|
@ -4589,7 +4589,6 @@ void ChainstateManager::LoadExternalBlockFile(
|
|||
|
||||
int nLoaded = 0;
|
||||
try {
|
||||
// This takes over fileIn and calls fclose() on it in the BufferedFile destructor
|
||||
BufferedFile blkdat{fileIn, 2 * MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE + 8, CLIENT_VERSION};
|
||||
// nRewind indicates where to resume scanning in case something goes wrong,
|
||||
// such as a block fails to deserialize.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue