diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-10-20 13:28:11 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-10-20 16:29:02 +0200 |
commit | fac36b94ef32567c0f10b605a3a441d11559e56e (patch) | |
tree | 89d5db1c3750c10ffa74c64fab2d7c843fb0897c /src | |
parent | fc1073bb450d67d5229123bd9bd9a0c1f4dc7cd3 (diff) |
refactor: Remove CBlockFileInfo::SetNull
Diffstat (limited to 'src')
-rw-r--r-- | src/chain.h | 30 | ||||
-rw-r--r-- | src/node/blockstorage.cpp | 2 | ||||
-rw-r--r-- | src/node/blockstorage.h | 1 |
3 files changed, 9 insertions, 24 deletions
diff --git a/src/chain.h b/src/chain.h index 4bf2001f74..f9121fb861 100644 --- a/src/chain.h +++ b/src/chain.h @@ -42,13 +42,13 @@ static constexpr int64_t MAX_BLOCK_TIME_GAP = 90 * 60; class CBlockFileInfo { public: - unsigned int nBlocks; //!< number of blocks stored in file - unsigned int nSize; //!< number of used bytes of block file - unsigned int nUndoSize; //!< number of used bytes in the undo file - unsigned int nHeightFirst; //!< lowest height of block in file - unsigned int nHeightLast; //!< highest height of block in file - uint64_t nTimeFirst; //!< earliest time of block in file - uint64_t nTimeLast; //!< latest time of block in file + unsigned int nBlocks{}; //!< number of blocks stored in file + unsigned int nSize{}; //!< number of used bytes of block file + unsigned int nUndoSize{}; //!< number of used bytes in the undo file + unsigned int nHeightFirst{}; //!< lowest height of block in file + unsigned int nHeightLast{}; //!< highest height of block in file + uint64_t nTimeFirst{}; //!< earliest time of block in file + uint64_t nTimeLast{}; //!< latest time of block in file SERIALIZE_METHODS(CBlockFileInfo, obj) { @@ -61,21 +61,7 @@ public: READWRITE(VARINT(obj.nTimeLast)); } - void SetNull() - { - nBlocks = 0; - nSize = 0; - nUndoSize = 0; - nHeightFirst = 0; - nHeightLast = 0; - nTimeFirst = 0; - nTimeLast = 0; - } - - CBlockFileInfo() - { - SetNull(); - } + CBlockFileInfo() {} std::string ToString() const; diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index f8f1aab551..53f616de23 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -254,7 +254,7 @@ void BlockManager::PruneOneBlockFile(const int fileNumber) } } - m_blockfile_info[fileNumber].SetNull(); + m_blockfile_info.at(fileNumber) = CBlockFileInfo{}; m_dirty_fileinfo.insert(fileNumber); } diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index ac97728c05..ba44d31581 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -32,7 +32,6 @@ class BlockValidationState; class CAutoFile; class CBlock; -class CBlockFileInfo; class CBlockUndo; class CChainParams; class Chainstate; |