message: Update the block creation
diff: @@ -159,7 +159,10 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
  if (chainparams.MineBlocksOnDemand())
  pblock->nVersion = GetArg("-blockversion", pblock->nVersion);
  - pblock->nTime = GetAdjustedTime();
  + uint32_t txProofTime = GetAdjustedTime();
  + if(fProofOfStake)
  + txProofTime &= STAKE_TIMESTAMP_MASK;
  + pblock->nTime = txProofTime;
  const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast();
  nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST)
  @@ -183,7 +186,6 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
  coinbaseTx.vin.resize(1);
  coinbaseTx.vin[0].prevout.SetNull();
  coinbaseTx.vout.resize(1);
  - uint32_t txProofTime = GetAdjustedTime();
  coinbaseTx.nTime = txProofTime;
  if (fProofOfStake)
  {
  @@ -198,6 +200,16 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
  coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;
  pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx));
  + // Create coinstake transaction.
  + if(fProofOfStake)
  + {
  + CMutableTransaction coinstakeTx;
  + coinstakeTx.vout.resize(2);
  + coinstakeTx.vout[0].SetEmpty();
  + coinstakeTx.vout[1].scriptPubKey = scriptPubKeyIn;
  + pblock->vtx[1] = MakeTransactionRef(std::move(coinstakeTx));
  + }
  +
  //Add the contract data into the proof transaction
  int contrTxIndex = fProofOfStake ? 1 : 0;
  