Skip to content

Commit

Permalink
[RPC] enable mint only for regtest
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Jun 5, 2019
1 parent dcc74f8 commit 834cbeb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2769,8 +2769,10 @@ 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");
/*

if (Params().NetworkID() != CBaseChainParams::REGTEST)
throw JSONRPCError(RPC_WALLET_ERROR, "zPIV minting is DISABLED");

LOCK2(cs_main, pwalletMain->cs_wallet);

if (params.size() == 1)
Expand Down Expand Up @@ -2839,7 +2841,6 @@ UniValue mintzerocoin(const UniValue& params, bool fHelp)
}

return arrMints;
*/
}

UniValue spendzerocoin(const UniValue& params, bool fHelp)
Expand Down Expand Up @@ -2894,7 +2895,7 @@ 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)
if (fMintChange && Params().NetworkID() != CBaseChainParams::REGTEST)
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() : "";
Expand Down Expand Up @@ -3007,7 +3008,7 @@ 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)
if (fMintChange && Params().NetworkID() != CBaseChainParams::REGTEST)
throw JSONRPCError(RPC_WALLET_ERROR, "zPIV minting is DISABLED, cannot mint change");

int64_t nTimeStart = GetTimeMillis();
Expand Down

0 comments on commit 834cbeb

Please sign in to comment.