Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved startmasternode help handling
Browse files Browse the repository at this point in the history
panleone committed Mar 4, 2023
1 parent 8b00afa commit 958a76c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/rpc/masternode.cpp
Original file line number Diff line number Diff line change
@@ -408,6 +408,15 @@ void SerializeMNB(UniValue& statusObjRet, const CMasternodeBroadcast& mnb, const

UniValue startmasternode(const JSONRPCRequest& request)
{
// Skip after legacy obsolete. !TODO: remove when transition to DMN is complete
if (deterministicMNManager->LegacyMNObsolete()) {
if (request.fHelp) {
throw std::runtime_error("startmasternode (deprecated and no longer functional)");
} else {
throw JSONRPCError(RPC_MISC_ERROR, "startmasternode is not supported when deterministic masternode list is active (DIP3)");
}
}

CWallet * const pwallet = GetWalletForJSONRPCRequest(request);

if (!EnsureWalletIsAvailable(pwallet, request.fHelp))
@@ -457,10 +466,7 @@ UniValue startmasternode(const JSONRPCRequest& request)

"\nExamples:\n" +
HelpExampleCli("startmasternode", "\"alias\" \"0\" \"my_mn\"") + HelpExampleRpc("startmasternode", "\"alias\" \"0\" \"my_mn\""));
// Skip after legacy obsolete. !TODO: remove when transition to DMN is complete
if (deterministicMNManager->LegacyMNObsolete()) {
throw JSONRPCError(RPC_MISC_ERROR, "startmasternode is not supported when deterministic masternode list is active (DIP3)");
}

bool fLock = (request.params[1].get_str() == "true" ? true : false);

EnsureWalletIsUnlocked(pwallet);

0 comments on commit 958a76c

Please sign in to comment.