mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-26 06:44:32 +00:00
Merge pull request #2057 from Diapolo/FlushBlockFile
FlushBlockFile(): check for valid FILE pointer
This commit is contained in:
commit
d79775a04d
12
src/main.cpp
12
src/main.cpp
@ -1538,12 +1538,16 @@ void static FlushBlockFile()
|
|||||||
CDiskBlockPos posOld(nLastBlockFile, 0);
|
CDiskBlockPos posOld(nLastBlockFile, 0);
|
||||||
|
|
||||||
FILE *fileOld = OpenBlockFile(posOld);
|
FILE *fileOld = OpenBlockFile(posOld);
|
||||||
FileCommit(fileOld);
|
if (fileOld) {
|
||||||
fclose(fileOld);
|
FileCommit(fileOld);
|
||||||
|
fclose(fileOld);
|
||||||
|
}
|
||||||
|
|
||||||
fileOld = OpenUndoFile(posOld);
|
fileOld = OpenUndoFile(posOld);
|
||||||
FileCommit(fileOld);
|
if (fileOld) {
|
||||||
fclose(fileOld);
|
FileCommit(fileOld);
|
||||||
|
fclose(fileOld);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FindUndoPos(int nFile, CDiskBlockPos &pos, unsigned int nAddSize);
|
bool FindUndoPos(int nFile, CDiskBlockPos &pos, unsigned int nAddSize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user