message: Move recentRejects initialization to top of InitBlockIndex
  This avoids that premature return in the condition that a new chain is initialized
  results in NULL pointer errors due to recentReject not being constructed.
  Also add assertions where it is used.
diff: @@ -4710,6 +4710,10 @@ bool LoadBlockIndex(std::string& strError)
  bool InitBlockIndex()
  {
  LOCK(cs_main);
  +
  + // Initialize global variables that cannot be constructed at startup.
  + recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));
  +
  // Check whether we're already initialized
  if (chainActive.Genesis() != NULL)
  return true;
  @@ -4741,9 +4745,6 @@ bool InitBlockIndex()
  }
  }
  - // Initialize global variables that cannot be constructed at startup.
  - recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));
  -
  return true;
  }
  @@ -5033,6 +5034,7 @@ bool static AlreadyHave(const CInv& inv)
  {
  switch (inv.type) {
  case MSG_TX: {
  + assert(recentRejects);
  if (chainActive.Tip()->GetBlockHash() != hashRecentRejectsChainTip) {
  // If the chain tip has changed previously rejected transactions
  // might be now valid, e.g. due to a nLockTime'd tx becoming valid,
  @@ -5773,6 +5775,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
  // Probably non-standard or insufficient fee/priority
  LogPrint(BCLog::MEMPOOL, " removed orphan tx %s\n", orphanHash.ToString());
  vEraseQueue.push_back(orphanHash);
  + assert(recentRejects);
  recentRejects->insert(orphanHash);
  }
  mempool.check(pcoinsTip);
  @@ -5802,6 +5805,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
  // already in the mempool; if the tx isn't in the mempool that
  // means it was rejected and we shouldn't ask for it again.
  if (!mempool.exists(tx.GetHash())) {
  + assert(recentRejects);
  recentRejects->insert(tx.GetHash());
  }
  if (pfrom->fWhitelisted) {
  