message: masternode: CalculateScore and GetBlockHash accessing to chainActive without cs_main fix.
diff: @@ -23,23 +23,31 @@ std::map<int64_t, uint256> mapCacheBlockHashes;
  //Get the last hash that matches the modulus given. Processed in reverse order
  bool GetBlockHash(uint256& hash, int nBlockHeight)
  {
  - if (chainActive.Tip() == NULL) return false;
  + int tipHeight;
  + const CBlockIndex* tipIndex;
  + {
  + LOCK(cs_main);
  + CBlockIndex *pindex = chainActive.Tip();
  + if (!pindex) return false;
  + tipHeight = pindex->nHeight;
  + tipIndex = mapBlockIndex[pindex->GetBlockHash()];
  + }
  if (nBlockHeight == 0)
  - nBlockHeight = chainActive.Tip()->nHeight;
  + nBlockHeight = tipHeight;
  if (mapCacheBlockHashes.count(nBlockHeight)) {
  hash = mapCacheBlockHashes[nBlockHeight];
  return true;
  }
  - const CBlockIndex* BlockLastSolved = chainActive.Tip();
  - const CBlockIndex* BlockReading = chainActive.Tip();
  + const CBlockIndex* BlockLastSolved = tipIndex;
  + const CBlockIndex* BlockReading = tipIndex;
  - if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || chainActive.Tip()->nHeight + 1 < nBlockHeight) return false;
  + if (BlockLastSolved == nullptr || BlockLastSolved->nHeight == 0 || tipHeight + 1 < nBlockHeight) return false;
  int nBlocksAgo = 0;
  - if (nBlockHeight > 0) nBlocksAgo = (chainActive.Tip()->nHeight + 1) - nBlockHeight;
  + if (nBlockHeight > 0) nBlocksAgo = (tipHeight + 1) - nBlockHeight;
  assert(nBlocksAgo >= 0);
  int n = 0;
  @@ -157,7 +165,10 @@ bool CMasternode::UpdateFromNewBroadcast(CMasternodeBroadcast& mnb)
  //
  uint256 CMasternode::CalculateScore(int mod, int64_t nBlockHeight)
  {
  + {
  + LOCK(cs_main);
  if (chainActive.Tip() == NULL) return UINT256_ZERO;
  + }
  uint256 hash;
  uint256 aux = vin.prevout.hash + vin.prevout.n;
  