File tree Expand file tree Collapse file tree 3 files changed +9
-24
lines changed Expand file tree Collapse file tree 3 files changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,13 @@ static constexpr int64_t MAX_BLOCK_TIME_GAP = 90 * 60;
4242class CBlockFileInfo
4343{
4444public:
45- unsigned int nBlocks; // !< number of blocks stored in file
46- unsigned int nSize; // !< number of used bytes of block file
47- unsigned int nUndoSize; // !< number of used bytes in the undo file
48- unsigned int nHeightFirst; // !< lowest height of block in file
49- unsigned int nHeightLast; // !< highest height of block in file
50- uint64_t nTimeFirst; // !< earliest time of block in file
51- uint64_t nTimeLast; // !< latest time of block in file
45+ unsigned int nBlocks{} ; // !< number of blocks stored in file
46+ unsigned int nSize{} ; // !< number of used bytes of block file
47+ unsigned int nUndoSize{} ; // !< number of used bytes in the undo file
48+ unsigned int nHeightFirst{} ; // !< lowest height of block in file
49+ unsigned int nHeightLast{} ; // !< highest height of block in file
50+ uint64_t nTimeFirst{} ; // !< earliest time of block in file
51+ uint64_t nTimeLast{} ; // !< latest time of block in file
5252
5353 SERIALIZE_METHODS (CBlockFileInfo, obj)
5454 {
@@ -61,21 +61,7 @@ class CBlockFileInfo
6161 READWRITE (VARINT (obj.nTimeLast ));
6262 }
6363
64- void SetNull ()
65- {
66- nBlocks = 0 ;
67- nSize = 0 ;
68- nUndoSize = 0 ;
69- nHeightFirst = 0 ;
70- nHeightLast = 0 ;
71- nTimeFirst = 0 ;
72- nTimeLast = 0 ;
73- }
74-
75- CBlockFileInfo ()
76- {
77- SetNull ();
78- }
64+ CBlockFileInfo () {}
7965
8066 std::string ToString () const ;
8167
Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ void BlockManager::PruneOneBlockFile(const int fileNumber)
254254 }
255255 }
256256
257- m_blockfile_info[fileNumber]. SetNull () ;
257+ m_blockfile_info. at (fileNumber) = CBlockFileInfo{} ;
258258 m_dirty_fileinfo.insert (fileNumber);
259259}
260260
Original file line number Diff line number Diff line change 3232class BlockValidationState ;
3333class CAutoFile ;
3434class CBlock ;
35- class CBlockFileInfo ;
3635class CBlockUndo ;
3736class CChainParams ;
3837class Chainstate ;
You can’t perform that action at this time.
0 commit comments