Skip to content

Commit

Permalink
Merge pull request bitcoin#922 from sickpig/fix-warnings
Browse files Browse the repository at this point in the history
Initialize pindexNewTip at declaration time
  • Loading branch information
gandrewstone committed Jan 17, 2018
2 parents e90fd2c + 15be0a8 commit 4a04743
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3423,7 +3423,7 @@ static bool ActivateBestChainStep(CValidationState &state,
nHeight = nTargetHeight;

// Connect new blocks.
CBlockIndex *pindexNewTip;
CBlockIndex *pindexNewTip = nullptr;
BOOST_REVERSE_FOREACH (CBlockIndex *pindexConnect, vpindexToConnect)
{
// Check if the best chain has changed while we were disconnecting or processing blocks.
Expand Down Expand Up @@ -3500,7 +3500,7 @@ static bool ActivateBestChainStep(CValidationState &state,
break; // stop processing more blocks if the last one was invalid.

// Notify the UI with the new block tip information.
if (pindexMostWork->nHeight >= nHeight && pindexNewTip != NULL)
if (pindexMostWork->nHeight >= nHeight && pindexNewTip != nullptr)
uiInterface.NotifyBlockTip(true, pindexNewTip);

if (fContinue)
Expand Down

0 comments on commit 4a04743

Please sign in to comment.