diff options
Diffstat (limited to 'src/chain.h')
-rw-r--r-- | src/chain.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/chain.h b/src/chain.h index c5304b7d6f..ef7e6f9554 100644 --- a/src/chain.h +++ b/src/chain.h @@ -216,14 +216,14 @@ public: //! (memory only) Sequential id assigned to distinguish order in which blocks are received. int32_t nSequenceId; - //! (memory only) Maximum nTime in the chain upto and including this block. + //! (memory only) Maximum nTime in the chain up to and including this block. unsigned int nTimeMax; void SetNull() { - phashBlock = NULL; - pprev = NULL; - pskip = NULL; + phashBlock = nullptr; + pprev = nullptr; + pskip = nullptr; nHeight = 0; nFile = 0; nDataPos = 0; @@ -247,7 +247,7 @@ public: SetNull(); } - CBlockIndex(const CBlockHeader& block) + explicit CBlockIndex(const CBlockHeader& block) { SetNull(); @@ -437,20 +437,20 @@ private: std::vector<CBlockIndex*> vChain; public: - /** Returns the index entry for the genesis block of this chain, or NULL if none. */ + /** Returns the index entry for the genesis block of this chain, or nullptr if none. */ CBlockIndex *Genesis() const { - return vChain.size() > 0 ? vChain[0] : NULL; + return vChain.size() > 0 ? vChain[0] : nullptr; } - /** Returns the index entry for the tip of this chain, or NULL if none. */ + /** Returns the index entry for the tip of this chain, or nullptr if none. */ CBlockIndex *Tip() const { - return vChain.size() > 0 ? vChain[vChain.size() - 1] : NULL; + return vChain.size() > 0 ? vChain[vChain.size() - 1] : nullptr; } - /** Returns the index entry at a particular height in this chain, or NULL if no such height exists. */ + /** Returns the index entry at a particular height in this chain, or nullptr if no such height exists. */ CBlockIndex *operator[](int nHeight) const { if (nHeight < 0 || nHeight >= (int)vChain.size()) - return NULL; + return nullptr; return vChain[nHeight]; } @@ -465,12 +465,12 @@ public: return (*this)[pindex->nHeight] == pindex; } - /** Find the successor of a block in this chain, or NULL if the given index is not found or is the tip. */ + /** Find the successor of a block in this chain, or nullptr if the given index is not found or is the tip. */ CBlockIndex *Next(const CBlockIndex *pindex) const { if (Contains(pindex)) return (*this)[pindex->nHeight + 1]; else - return NULL; + return nullptr; } /** Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */ @@ -482,7 +482,7 @@ public: void SetTip(CBlockIndex *pindex); /** Return a CBlockLocator that refers to a block in this chain (by default the tip). */ - CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const; + CBlockLocator GetLocator(const CBlockIndex *pindex = nullptr) const; /** Find the last common block between this chain and a block index entry. */ const CBlockIndex *FindFork(const CBlockIndex *pindex) const; |