Browse Source

Fail on get_chainactive before lock if checks fail

pull/4/head
Michael Toutonghi 6 years ago
parent
commit
3c40a9a667
  1. 8
      src/miner.cpp

8
src/miner.cpp

@ -813,11 +813,13 @@ int32_t waitForPeers(const CChainParams &chainparams)
#ifdef ENABLE_WALLET
CBlockIndex *get_chainactive(int32_t height)
{
LOCK(cs_main);
if ( chainActive.Tip() != 0 )
if ( chainActive.LastTip() != 0 )
{
if ( height <= chainActive.Tip()->nHeight )
if ( height <= chainActive.LastTip()->nHeight )
{
LOCK(cs_main);
return(chainActive[height]);
}
// else fprintf(stderr,"get_chainactive height %d > active.%d\n",height,chainActive.Tip()->nHeight);
}
//fprintf(stderr,"get_chainactive null chainActive.Tip() height %d\n",height);

Loading…
Cancel
Save