@@ -530,17 +530,17 @@ class CChain
530
530
std::vector<CBlockIndex*> vChain;
531
531
532
532
public:
533
- /* * Returns the index entry for the genesis block of this chain, or NULL if none. */
533
+ /* * Returns the index entry for the genesis block of this chain, or nullptr if none. */
534
534
CBlockIndex* Genesis () const
535
535
{
536
- return vChain.size () > 0 ? vChain[0 ] : NULL ;
536
+ return vChain.size () > 0 ? vChain[0 ] : nullptr ;
537
537
}
538
538
539
- /* * Returns the index entry for the tip of this chain, or NULL if none. */
539
+ /* * Returns the index entry for the tip of this chain, or nullptr if none. */
540
540
CBlockIndex* Tip (bool fProofOfStake = false ) const
541
541
{
542
542
if (vChain.size () < 1 )
543
- return NULL ;
543
+ return nullptr ;
544
544
545
545
CBlockIndex* pindex = vChain[vChain.size () - 1 ];
546
546
@@ -551,11 +551,11 @@ class CChain
551
551
return pindex;
552
552
}
553
553
554
- /* * Returns the index entry at a particular height in this chain, or NULL if no such height exists. */
554
+ /* * Returns the index entry at a particular height in this chain, or nullptr if no such height exists. */
555
555
CBlockIndex* operator [](int nHeight) const
556
556
{
557
557
if (nHeight < 0 || nHeight >= (int )vChain.size ())
558
- return NULL ;
558
+ return nullptr ;
559
559
return vChain[nHeight];
560
560
}
561
561
@@ -572,13 +572,13 @@ class CChain
572
572
return (*this )[pindex->nHeight ] == pindex;
573
573
}
574
574
575
- /* * Find the successor of a block in this chain, or NULL if the given index is not found or is the tip. */
575
+ /* * Find the successor of a block in this chain, or nullptr if the given index is not found or is the tip. */
576
576
CBlockIndex* Next (const CBlockIndex* pindex) const
577
577
{
578
578
if (Contains (pindex))
579
579
return (*this )[pindex->nHeight + 1 ];
580
580
else
581
- return NULL ;
581
+ return nullptr ;
582
582
}
583
583
584
584
/* * Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */
@@ -591,7 +591,7 @@ class CChain
591
591
void SetTip (CBlockIndex* pindex);
592
592
593
593
/* * Return a CBlockLocator that refers to a block in this chain (by default the tip). */
594
- CBlockLocator GetLocator (const CBlockIndex* pindex = NULL ) const ;
594
+ CBlockLocator GetLocator (const CBlockIndex* pindex = nullptr ) const ;
595
595
596
596
/* * Find the last common block between this chain and a block index entry. */
597
597
const CBlockIndex* FindFork (const CBlockIndex* pindex) const ;
0 commit comments