mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 15:39:05 +01:00
Merge #15118: Refactor block file logic
04cca33094Style cleanup. (Jim Posen)4c01e4e159flatfile: Unit tests for FlatFileSeq methods. (Jim Posen)65a489e93dscripted-diff: Rename CBlockDiskPos to FlatFilePos. (Jim Posen)d6d8a78f26Move CDiskBlockPos from chain to flatfile. (Jim Posen)e0380933e3validation: Refactor file flush logic into FlatFileSeq. (Jim Posen)992404b31evalidation: Refactor block file pre-allocation into FlatFileSeq. (Jim Posen)e2d2abb99fvalidation: Refactor OpenDiskFile into method on FlatFileSeq. (Jim Posen)9183d6ef65validation: Extract basic block file logic into FlatFileSeq class. (Jim Posen)62e7addb63util: Move CheckDiskSpace to util. (Jim Posen) Pull request description: This cleans up and refactors block file helpers so that they may be used by the block filter indexer. Per [design discussion](https://github.com/bitcoin/bitcoin/pull/14121#issuecomment-451252591) about storing BIP 157 block filters, it has been suggested that they are stored in the same way as block and undo data. This refactor is sufficient to simplify file operations for this use case, though in the future perhaps more pruning-related logic ought to be moved into the new classes. The basic abstraction is a `FlatFileSeq` which manages access to a sequence of numbered files into which raw data is written. Tree-SHA512: b2108756777f2dad8964a1a2ef2764486e708a4a4a8cfac47b5de8bcb0625388964438eb096b10cfd9ea39212c299b5cb32fa943e768db2333cf49ea7def157e
This commit is contained in:
@@ -72,6 +72,7 @@ bool RenameOver(fs::path src, fs::path dest);
|
||||
bool LockDirectory(const fs::path& directory, const std::string lockfile_name, bool probe_only=false);
|
||||
void UnlockDirectory(const fs::path& directory, const std::string& lockfile_name);
|
||||
bool DirIsWritable(const fs::path& directory);
|
||||
bool CheckDiskSpace(const fs::path& dir, uint64_t additional_bytes = 0);
|
||||
|
||||
/** Release all directory locks. This is used for unit testing only, at runtime
|
||||
* the global destructor will take care of the locks.
|
||||
|
||||
Reference in New Issue
Block a user