mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
validation: Refactor file flush logic into FlatFileSeq.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user