| 2555 | } |
| 2556 | |
| 2557 | void static FlushBlockFile(bool fFinalize = false) |
| 2558 | { |
| 2559 | LOCK(cs_LastBlockFile); |
| 2560 | |
| 2561 | CDiskBlockPos posOld(nLastBlockFile, 0); |
| 2562 | |
| 2563 | FILE* fileOld = OpenBlockFile(posOld); |
| 2564 | if (fileOld) { |
| 2565 | if (fFinalize) |
| 2566 | TruncateFile(fileOld, vinfoBlockFile[nLastBlockFile].nSize); |
| 2567 | FileCommit(fileOld); |
| 2568 | fclose(fileOld); |
| 2569 | } |
| 2570 | |
| 2571 | fileOld = OpenUndoFile(posOld); |
| 2572 | if (fileOld) { |
| 2573 | if (fFinalize) |
| 2574 | TruncateFile(fileOld, vinfoBlockFile[nLastBlockFile].nUndoSize); |
| 2575 | FileCommit(fileOld); |
| 2576 | fclose(fileOld); |
| 2577 | } |
| 2578 | } |
| 2579 | |
| 2580 | bool FindUndoPos(CValidationState& state, int nFile, CDiskBlockPos& pos, unsigned int nAddSize); |
| 2581 |
no test coverage detected