validation: Refactor file flush logic into FlatFileSeq.

This commit is contained in:
Jim Posen
2019-01-06 10:14:35 -08:00
parent 992404b31e
commit e0380933e3
3 changed files with 33 additions and 18 deletions

View File

@@ -45,6 +45,15 @@ public:
* @return The number of bytes successfully allocated.
*/
size_t Allocate(const CDiskBlockPos& pos, size_t add_size, bool& out_of_space);
/**
* Commit a file to disk, and optionally truncate off extra pre-allocated bytes if final.
*
* @param[in] pos The first unwritten position in the file to be flushed.
* @param[in] finalize True if no more data will be written to this file.
* @return true on success, false on failure.
*/
bool Flush(const CDiskBlockPos& pos, bool finalize = false);
};
#endif // BITCOIN_FLATFILE_H