From 9f3fa2add468148c0791b75d99c8458a261fe3be Mon Sep 17 00:00:00 2001 From: random-zebra Date: Tue, 30 Apr 2019 11:37:12 +0200 Subject: [PATCH] [RPC] Disable zerocoin minting disabling also remint of change of a zc spend --- src/wallet/rpcwallet.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 03ef1408ff4b1..3483fd03cc110 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2769,6 +2769,8 @@ UniValue mintzerocoin(const UniValue& params, bool fHelp) "\nAs a json rpc call\n" + HelpExampleRpc("mintzerocoin", "13, \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"")); + throw JSONRPCError(RPC_WALLET_ERROR, "zPIV minting is DISABLED"); + /* LOCK2(cs_main, pwalletMain->cs_wallet); if (params.size() == 1) @@ -2837,6 +2839,7 @@ UniValue mintzerocoin(const UniValue& params, bool fHelp) } return arrMints; + */ } UniValue spendzerocoin(const UniValue& params, bool fHelp) @@ -2891,6 +2894,8 @@ UniValue spendzerocoin(const UniValue& params, bool fHelp) CAmount nAmount = AmountFromValue(params[0]); // Spending amount bool fMintChange = params[1].get_bool(); // Mint change to zPIV + if (fMintChange) + throw JSONRPCError(RPC_WALLET_ERROR, "zPIV minting is DISABLED, cannot mint change"); bool fMinimizeChange = params[2].get_bool(); // Minimize change std::string address_str = params.size() > 3 ? params[3].get_str() : ""; bool ispublicspend = params.size() > 4 ? params[3].get_bool() : true; @@ -3001,6 +3006,10 @@ UniValue spendzerocoinmints(const UniValue& params, bool fHelp) extern UniValue DoZpivSpend(const CAmount nAmount, bool fMintChange, bool fMinimizeChange, vector& vMintsSelected, std::string address_str, bool ispublicspend) { + // zerocoin MINT is disabled. fMintChange should be false here. Double check + if (fMintChange) + throw JSONRPCError(RPC_WALLET_ERROR, "zPIV minting is DISABLED, cannot mint change"); + int64_t nTimeStart = GetTimeMillis(); CBitcoinAddress address = CBitcoinAddress(); // Optional sending address. Dummy initialization here. CWalletTx wtx;