Skip to content

Commit

Permalink
add compressed option to masternode genkey (#2232)
Browse files Browse the repository at this point in the history
* add compressed option to `masternode genkey`

* use ParseBoolV method

* adjust help message for masternode genkey
  • Loading branch information
nmarley authored and UdjinM6 committed Aug 21, 2018
1 parent 98ed90c commit 2997d6d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rpc/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ UniValue masternode(const JSONRPCRequest& request)
" check - Force check all masternodes and remove invalid ones\n"
" count - Get information about number of masternodes (DEPRECATED options: 'total', 'ps', 'enabled', 'qualify', 'all')\n"
" current - Print info on current masternode winner to be paid the next block (calculated locally)\n"
" genkey - Generate new masternodeprivkey\n"
" genkey - Generate new masternodeprivkey, optional param: 'compressed' (boolean, optional, default=false) generate compressed privkey\n"
#ifdef ENABLE_WALLET
" outputs - Print masternode compatible outputs\n"
" start-alias - Start single remote masternode by assigned alias configured in masternode.conf\n"
Expand Down Expand Up @@ -375,8 +375,13 @@ UniValue masternode(const JSONRPCRequest& request)

if (strCommand == "genkey")
{
bool fCompressed = false;
if (request.params.size() > 1) {
fCompressed = ParseBoolV(request.params[1], "compressed");
}

CKey secret;
secret.MakeNewKey(false);
secret.MakeNewKey(fCompressed);

return CBitcoinSecret(secret).ToString();
}
Expand Down

0 comments on commit 2997d6d

Please sign in to comment.