diff --git a/src/chain.h b/src/chain.h index 7e1296153a..2ed424c48e 100644 --- a/src/chain.h +++ b/src/chain.h @@ -40,13 +40,13 @@ extern RecursiveMutex cs_main; 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) { @@ -59,21 +59,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 2c8cacccef..4aa9d0c993 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -164,7 +164,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 1b919df908..a0c25f10d9 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -21,7 +21,6 @@ class CActiveMasternodeManager; class ArgsManager; class BlockValidationState; class CBlock; -class CBlockFileInfo; class CBlockUndo; class CChain; class CChainParams;