message: Fixed bug (reindex fails).
diff: @@ -3862,10 +3862,13 @@ static bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CValidation
  }
  // Get prev block index
  + CBlockIndex* pindexPrev = nullptr;
  + if(pindex->nHeight > 0){
  BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);
  if (mi == mapBlockIndex.end())
  return state.DoS(10, error("AcceptBlock() : prev block not found"));
  - CBlockIndex* pindexPrev = (*mi).second;
  + pindexPrev = (*mi).second;
  + }
  // Get block height
  int nHeight = pindex->nHeight;
  @@ -3879,7 +3882,7 @@ static bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CValidation
  return error("AcceptBlock() : rejected by synchronized checkpoint");
  // Check timestamp against prev
  - if (block.GetBlockTime() <= pindexPrev->GetBlockTime() || FutureDrift(block.GetBlockTime()) < pindexPrev->GetBlockTime())
  + if (pindexPrev && (block.GetBlockTime() <= pindexPrev->GetBlockTime() || FutureDrift(block.GetBlockTime()) < pindexPrev->GetBlockTime()))
  return error("AcceptBlock() : block's timestamp is too early");
  // Enforce rule that the coinbase starts with serialized block height
  