message: [Refactor][PoS] Do not calculate the prevBlock medianTimePast on every cycle of the CreateCoinStake loop.
diff: @@ -2382,6 +2382,7 @@ bool CWallet::CreateCoinStake(
  CScript scriptPubKeyKernel;
  bool fKernelFound = false;
  int nAttempts = 0;
  + int64_t chainTime = pindexPrev->GetMedianTimePast();
  for (std::unique_ptr<CStakeInput>& stakeInput : listInputs) {
  nCredit = 0;
  // Make sure the wallet is unlocked and shutdown hasn't been requested
  @@ -2400,7 +2401,7 @@ bool CWallet::CreateCoinStake(
  //iterates each utxo inside of CheckStakeKernelHash()
  if (Stake(pindexPrev, stakeInput.get(), nBits, block.GetBlockTime(), nTxNewTime, hashProofOfStake)) {
  //Double check that this will pass time requirements
  - if (nTxNewTime <= chainActive.Tip()->GetMedianTimePast() && Params().NetworkID() != CBaseChainParams::REGTEST) {
  + if (nTxNewTime <= chainTime && Params().NetworkID() != CBaseChainParams::REGTEST) {
  LogPrintf("CreateCoinStake() : kernel found, but it is too far in the past \n");
  continue;
  }
  