@@ -307,30 +307,6 @@ struct CNodeStateStats {
307307 std::vector<int > vHeightInFlight;
308308};
309309
310- struct CDiskTxPos : public CDiskBlockPos
311- {
312- unsigned int nTxOffset; // after header
313-
314- ADD_SERIALIZE_METHODS;
315-
316- template <typename Stream, typename Operation>
317- inline void SerializationOp (Stream& s, Operation ser_action, int nType, int nVersion) {
318- READWRITE (*(CDiskBlockPos*)this );
319- READWRITE (VARINT (nTxOffset));
320- }
321-
322- CDiskTxPos (const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
323- }
324-
325- CDiskTxPos () {
326- SetNull ();
327- }
328-
329- void SetNull () {
330- CDiskBlockPos::SetNull ();
331- nTxOffset = 0 ;
332- }
333- };
334310
335311
336312/* *
@@ -469,61 +445,6 @@ bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockI
469445/* * Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) */
470446bool TestBlockValidity (CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true , bool fCheckMerkleRoot = true );
471447
472-
473- class CBlockFileInfo
474- {
475- public:
476- unsigned int nBlocks; // !< number of blocks stored in file
477- unsigned int nSize; // !< number of used bytes of block file
478- unsigned int nUndoSize; // !< number of used bytes in the undo file
479- unsigned int nHeightFirst; // !< lowest height of block in file
480- unsigned int nHeightLast; // !< highest height of block in file
481- uint64_t nTimeFirst; // !< earliest time of block in file
482- uint64_t nTimeLast; // !< latest time of block in file
483-
484- ADD_SERIALIZE_METHODS;
485-
486- template <typename Stream, typename Operation>
487- inline void SerializationOp (Stream& s, Operation ser_action, int nType, int nVersion) {
488- READWRITE (VARINT (nBlocks));
489- READWRITE (VARINT (nSize));
490- READWRITE (VARINT (nUndoSize));
491- READWRITE (VARINT (nHeightFirst));
492- READWRITE (VARINT (nHeightLast));
493- READWRITE (VARINT (nTimeFirst));
494- READWRITE (VARINT (nTimeLast));
495- }
496-
497- void SetNull () {
498- nBlocks = 0 ;
499- nSize = 0 ;
500- nUndoSize = 0 ;
501- nHeightFirst = 0 ;
502- nHeightLast = 0 ;
503- nTimeFirst = 0 ;
504- nTimeLast = 0 ;
505- }
506-
507- CBlockFileInfo () {
508- SetNull ();
509- }
510-
511- std::string ToString () const ;
512-
513- /* * update statistics (does not update nSize) */
514- void AddBlock (unsigned int nHeightIn, uint64_t nTimeIn) {
515- if (nBlocks==0 || nHeightFirst > nHeightIn)
516- nHeightFirst = nHeightIn;
517- if (nBlocks==0 || nTimeFirst > nTimeIn)
518- nTimeFirst = nTimeIn;
519- nBlocks++;
520- if (nHeightIn > nHeightLast)
521- nHeightLast = nHeightIn;
522- if (nTimeIn > nTimeLast)
523- nTimeLast = nTimeIn;
524- }
525- };
526-
527448/* * RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */
528449class CVerifyDB {
529450public:
0 commit comments