Skip to content

Commit cdc18ea

Browse files
committed
[RPC] fix parameters check for spendzerocoin (missing ispublicspend)
1 parent 72bc39a commit cdc18ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3393,9 +3393,9 @@ UniValue mintzerocoin(const UniValue& params, bool fHelp)
33933393

33943394
UniValue spendzerocoin(const UniValue& params, bool fHelp)
33953395
{
3396-
if (fHelp || params.size() > 4 || params.size() < 3)
3396+
if (fHelp || params.size() > 5 || params.size() < 3)
33973397
throw std::runtime_error(
3398-
"spendzerocoin amount mintchange minimizechange ( \"address\" )\n"
3398+
"spendzerocoin amount mintchange minimizechange ( \"address\" ispublicspend)\n"
33993399
"\nSpend zPIV to a PIV address.\n" +
34003400
HelpRequiringPassphrase() + "\n"
34013401

@@ -3447,7 +3447,7 @@ UniValue spendzerocoin(const UniValue& params, bool fHelp)
34473447
throw JSONRPCError(RPC_WALLET_ERROR, "zPIV minting is DISABLED, cannot mint change");
34483448
bool fMinimizeChange = params[2].get_bool(); // Minimize change
34493449
std::string address_str = params.size() > 3 ? params[3].get_str() : "";
3450-
bool ispublicspend = params.size() > 4 ? params[3].get_bool() : true;
3450+
bool ispublicspend = params.size() > 4 ? params[4].get_bool() : true;
34513451

34523452
std::vector<CZerocoinMint> vMintsSelected;
34533453

@@ -3573,7 +3573,7 @@ extern UniValue DoZpivSpend(const CAmount nAmount, bool fMintChange, bool fMinim
35733573
outputs.push_back(std::pair<CBitcoinAddress*, CAmount>(&address, nAmount));
35743574
}
35753575

3576-
fSuccess = pwalletMain->SpendZerocoin(nAmount, wtx, receipt, vMintsSelected, fMintChange, fMinimizeChange, outputs);
3576+
fSuccess = pwalletMain->SpendZerocoin(nAmount, wtx, receipt, vMintsSelected, fMintChange, fMinimizeChange, outputs, nullptr, ispublicspend);
35773577

35783578
if (!fSuccess)
35793579
throw JSONRPCError(RPC_WALLET_ERROR, receipt.GetStatusMessage());

0 commit comments

Comments
 (0)