Skip to content

Commit

Permalink
[RPC] Disable zerocoin minting
Browse files Browse the repository at this point in the history
disabling also remint of change of a zc spend
  • Loading branch information
random-zebra committed Jun 5, 2019
1 parent fda5fff commit 9f3fa2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -2837,6 +2839,7 @@ UniValue mintzerocoin(const UniValue& params, bool fHelp)
}
return arrMints;
*/
}

UniValue spendzerocoin(const UniValue& params, bool fHelp)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -3001,6 +3006,10 @@ UniValue spendzerocoinmints(const UniValue& params, bool fHelp)

extern UniValue DoZpivSpend(const CAmount nAmount, bool fMintChange, bool fMinimizeChange, vector<CZerocoinMint>& 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;
Expand Down

0 comments on commit 9f3fa2a

Please sign in to comment.