diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-06-30 16:25:13 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-15 14:34:24 +0200 |
commit | fa56c421be04af846f479c30749b17e6663ab418 (patch) | |
tree | 26b3f14db47fb94a320da39e86eed7c5988ff654 /src/node/blockstorage.h | |
parent | 9999b89cd37fb2a23c5ebcd91d9cb31d69375933 (diff) | |
download | bitcoin-fa56c421be04af846f479c30749b17e6663ab418.tar.xz |
Return CAutoFile from BlockManager::Open*File()
This is a refactor.
Diffstat (limited to 'src/node/blockstorage.h')
-rw-r--r-- | src/node/blockstorage.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index b251ece31f..a89fa7f76e 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -29,6 +29,7 @@ #include <vector> class BlockValidationState; +class CAutoFile; class CBlock; class CBlockFileInfo; class CBlockUndo; @@ -126,7 +127,7 @@ private: FlatFileSeq BlockFileSeq() const; FlatFileSeq UndoFileSeq() const; - FILE* OpenUndoFile(const FlatFilePos& pos, bool fReadOnly = false) const; + CAutoFile OpenUndoFile(const FlatFilePos& pos, bool fReadOnly = false) const; bool WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const; bool UndoWriteToDisk(const CBlockUndo& blockundo, FlatFilePos& pos, const uint256& hashBlock) const; @@ -278,7 +279,7 @@ public: void UpdatePruneLock(const std::string& name, const PruneLockInfo& lock_info) EXCLUSIVE_LOCKS_REQUIRED(::cs_main); /** Open a block file (blk?????.dat) */ - FILE* OpenBlockFile(const FlatFilePos& pos, bool fReadOnly = false) const; + CAutoFile OpenBlockFile(const FlatFilePos& pos, bool fReadOnly = false) const; /** Translation to a filesystem path */ fs::path GetBlockPosFilename(const FlatFilePos& pos) const; |