From 2997d6d268395de6831f87f87fc21195f8da1920 Mon Sep 17 00:00:00 2001 From: Nathan Marley Date: Tue, 21 Aug 2018 07:08:11 -0700 Subject: [PATCH] add compressed option to `masternode genkey` (#2232) * add compressed option to `masternode genkey` * use ParseBoolV method * adjust help message for masternode genkey --- src/rpc/masternode.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index 97cf1d1c71..aedfce5772 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -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" @@ -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(); }