Browse Source

Merge pull request #2057 from Diapolo/FlushBlockFile

FlushBlockFile(): check for valid FILE pointer
0.8
Pieter Wuille 12 years ago
parent
commit
d79775a04d
  1. 4
      src/main.cpp

4
src/main.cpp

@ -1538,13 +1538,17 @@ void static FlushBlockFile()
CDiskBlockPos posOld(nLastBlockFile, 0); CDiskBlockPos posOld(nLastBlockFile, 0);
FILE *fileOld = OpenBlockFile(posOld); FILE *fileOld = OpenBlockFile(posOld);
if (fileOld) {
FileCommit(fileOld); FileCommit(fileOld);
fclose(fileOld); fclose(fileOld);
}
fileOld = OpenUndoFile(posOld); fileOld = OpenUndoFile(posOld);
if (fileOld) {
FileCommit(fileOld); FileCommit(fileOld);
fclose(fileOld); fclose(fileOld);
} }
}
bool FindUndoPos(int nFile, CDiskBlockPos &pos, unsigned int nAddSize); bool FindUndoPos(int nFile, CDiskBlockPos &pos, unsigned int nAddSize);

Loading…
Cancel
Save