RPC: disable privatesend rpc on masternodes completely

This commit is contained in:
UdjinM6 2018-02-27 23:08:27 +03:00
parent f486652476
commit 564b3d68fe

View File

@ -46,15 +46,15 @@ UniValue privatesend(const JSONRPCRequest& request)
" reset - Reset mixing\n" " reset - Reset mixing\n"
); );
if(fMasternodeMode)
throw JSONRPCError(RPC_INTERNAL_ERROR, "Client-side mixing is not supported on masternodes");
if(request.params[0].get_str() == "start") { if(request.params[0].get_str() == "start") {
{ {
LOCK(pwalletMain->cs_wallet); LOCK(pwalletMain->cs_wallet);
EnsureWalletIsUnlocked(); EnsureWalletIsUnlocked();
} }
if(fMasternodeMode)
return "Mixing is not supported from masternodes";
privateSendClient.fEnablePrivateSend = true; privateSendClient.fEnablePrivateSend = true;
bool result = privateSendClient.DoAutomaticDenominating(*g_connman); bool result = privateSendClient.DoAutomaticDenominating(*g_connman);
return "Mixing " + (result ? "started successfully" : ("start failed: " + privateSendClient.GetStatus() + ", will retry")); return "Mixing " + (result ? "started successfully" : ("start failed: " + privateSendClient.GetStatus() + ", will retry"));