message: [RPC] add mint hashStake to listmintedzerocoins output
diff: @@ -2594,6 +2594,7 @@ UniValue listmintedzerocoins(const UniValue& params, bool fHelp)
  " \"denomination\": n, (numeric) Coin denomination.\n"
  " \"mint height\": n (numeric) Height of the block containing this mint.\n"
  " \"confirmations\": n (numeric) Number of confirmations.\n"
  + " \"hash stake\": \"xxx\", (string) Mint serialstake hash in hex format.\n"
  " }\n"
  " ,..."
  "]\n"
  @@ -2617,7 +2618,7 @@ UniValue listmintedzerocoins(const UniValue& params, bool fHelp)
  UniValue jsonList(UniValue::VARR);
  if (fVerbose) {
  - for (const CMintMeta& m : setMints) {
  + for (auto m : setMints) {
  // Construct mint object
  UniValue objMint(UniValue::VOBJ);
  objMint.push_back(Pair("serial hash", m.hashSerial.GetHex())); // Serial hash
  @@ -2628,6 +2629,17 @@ UniValue listmintedzerocoins(const UniValue& params, bool fHelp)
  objMint.push_back(Pair("mint height", m.nHeight)); // Mint Height
  int nConfirmations = (m.nHeight && nBestHeight > m.nHeight) ? nBestHeight - m.nHeight : 0;
  objMint.push_back(Pair("confirmations", nConfirmations)); // Confirmations
  + // hashStake
  + if (m.hashStake == 0) {
  + CZerocoinMint mint;
  + if (pwalletMain->GetMint(m.hashSerial, mint)) {
  + uint256 hashStake = mint.GetSerialNumber().getuint256();
  + hashStake = Hash(hashStake.begin(), hashStake.end());
  + m.hashStake = hashStake;
  + pwalletMain->zpivTracker->UpdateState(m);
  + }
  + }
  + objMint.push_back(Pair("hash stake", m.hashStake.GetHex())); // Confirmations
  // Push back mint object
  jsonList.push_back(objMint);
  }
  