message: Fix edge case segfault.
  It is possible to access a map element that DNE if you force quit without downloading any blocks and then restart the wallet.
diff: @@ -5154,7 +5154,9 @@ bool static LoadBlockIndexDB(string& strError)
  LogPrintf("%s: Last shutdown was prepared: %s\n", __func__, fLastShutdownWasPrepared);
  //Check for inconsistency with block file info and internal state
  - if (!fLastShutdownWasPrepared && !GetBoolArg("-forcestart", false) && !GetBoolArg("-reindex", false) && pcoinsTip->GetBestBlock() != vSortedByHeight[vinfoBlockFile[nLastBlockFile].nHeightLast + 1].second->GetBlockHash()) {
  + if (!fLastShutdownWasPrepared && !GetBoolArg("-forcestart", false) && !GetBoolArg("-reindex", false)) {
  + unsigned int nHeightLastBlockFile = vinfoBlockFile[nLastBlockFile].nHeightLast + 1;
  + if (vSortedByHeight.size() > nHeightLastBlockFile && pcoinsTip->GetBestBlock() != vSortedByHeight[nHeightLastBlockFile].second->GetBlockHash()) {
  //The database is in a state where a block has been accepted and written to disk, but the
  //transaction database (pcoinsTip) was not flushed to disk, and is therefore not in sync with
  //the block index database.
  @@ -5163,7 +5165,8 @@ bool static LoadBlockIndexDB(string& strError)
  strError = "The wallet has been not been closed gracefully, causing the transaction database to be out of sync with the block database";
  return false;
  }
  - LogPrintf("%s : pcoinstip synced to block height %d, block index height %d\n", __func__, mapBlockIndex[pcoinsTip->GetBestBlock()]->nHeight, vSortedByHeight.size());
  + LogPrintf("%s : pcoinstip synced to block height %d, block index height %d\n", __func__,
  + mapBlockIndex[pcoinsTip->GetBestBlock()]->nHeight, vSortedByHeight.size());
  //get the index associated with the point in the chain that pcoinsTip is synced to
  CBlockIndex *pindexLastMeta = vSortedByHeight[vinfoBlockFile[nLastBlockFile].nHeightLast + 1].second;
  @@ -5209,8 +5212,11 @@ bool static LoadBlockIndexDB(string& strError)
  if (!view.Flush() || !pcoinsTip->Flush())
  LogPrintf("%s : failed to flush view\n", __func__);
  - LogPrintf("%s: Last block properly recorded: #%d %s\n", __func__, pindexLastMeta->nHeight, pindexLastMeta->GetBlockHash().ToString().c_str());
  - LogPrintf("%s : pcoinstip=%d %s\n", __func__, mapBlockIndex[pcoinsTip->GetBestBlock()]->nHeight, pcoinsTip->GetBestBlock().GetHex());
  + LogPrintf("%s: Last block properly recorded: #%d %s\n", __func__, pindexLastMeta->nHeight,
  + pindexLastMeta->GetBlockHash().ToString().c_str());
  + LogPrintf("%s : pcoinstip=%d %s\n", __func__, mapBlockIndex[pcoinsTip->GetBestBlock()]->nHeight,
  + pcoinsTip->GetBestBlock().GetHex());
  + }
  }
  // Check whether we need to continue reindexing
  