message: [Sapling][RPC] getnewsaplingaddress method created.
diff: #include "walletdb.h"
  #include "zpivchain.h"
  +#include "sapling/key_io_sapling.h"
  +
  #include <stdint.h>
  #include "libzerocoin/Coin.h"
  @@ -495,6 +497,29 @@ UniValue getnewstakingaddress(const JSONRPCRequest& request)
  return EncodeDestination(GetNewAddressFromLabel("coldstaking", request.params, CChainParams::STAKING_ADDRESS), CChainParams::STAKING_ADDRESS);
  }
  +UniValue getnewshieldedaddress(const JSONRPCRequest& request)
  +{
  + if (request.fHelp || request.params.size() > 1)
  + throw std::runtime_error(
  + "getnewshieldedaddress\n"
  + "\nReturns a new shielded address for receiving payments.\n"
  + "\nArguments:\n"
  + "\nResult:\n"
  + "\"address\" (string) The new shielded address.\n"
  + "\nExamples:\n"
  + + HelpExampleCli("getnewshieldedaddress", "")
  + + HelpExampleRpc("getnewshieldedaddress", "")
  + );
  +
  + EnsureWallet();
  +
  + LOCK2(cs_main, pwalletMain->cs_wallet);
  +
  + EnsureWalletIsUnlocked();
  +
  + return KeyIO::EncodePaymentAddress(pwalletMain->GenerateNewSaplingZKey());
  +}
  +
  UniValue delegatoradd(const JSONRPCRequest& request)
  {
  if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
  @@ -5005,6 +5030,9 @@ const CRPCCommand vWalletRPCCommands[] =
  { "wallet", "delegatoradd", &delegatoradd, true },
  { "wallet", "delegatorremove", &delegatorremove, true },
  + /** Sapling functions */
  + { "wallet", "getnewshieldedaddress", &getnewshieldedaddress, true },
  +
  /** Account functions (deprecated) */
  { "wallet", "getaccountaddress", &getaccountaddress, true },
  { "wallet", "getaccount", &getaccount, true },
  