mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Merge bitcoin/bitcoin#28691: refactor: Remove CBlockFileInfo::SetNull
fac36b94ef32567c0f10b605a3a441d11559e56e refactor: Remove CBlockFileInfo::SetNull (MarcoFalke) Pull request description: Seems better to use C++11 member initializers and then let the compiler figure out how to construct objects of this class. ACKs for top commit: stickies-v: ACK fac36b94ef32567c0f10b605a3a441d11559e56e pablomartin4btc: ACK fac36b94ef32567c0f10b605a3a441d11559e56e theStack: LGTM ACK fac36b94ef32567c0f10b605a3a441d11559e56e Tree-SHA512: aee741c8f668f0e5b658fc83f4ebd196b43fead3dd437afdb0a2dafe092ae3d559332b3d9d61985c92e1a59982d8f24942606e6a98598c6ef7ff43697e858725
This commit is contained in:
parent
0278163aa3
commit
f160e0dbb2
30
src/chain.h
30
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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@ class CActiveMasternodeManager;
|
||||
class ArgsManager;
|
||||
class BlockValidationState;
|
||||
class CBlock;
|
||||
class CBlockFileInfo;
|
||||
class CBlockUndo;
|
||||
class CChain;
|
||||
class CChainParams;
|
||||
|
Loading…
Reference in New Issue
Block a user