-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add compressed option to masternode genkey
#2232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below
src/rpc/masternode.cpp
Outdated
@@ -375,8 +375,13 @@ UniValue masternode(const JSONRPCRequest& request) | |||
|
|||
if (strCommand == "genkey") | |||
{ | |||
bool fCompressed = false; | |||
if (request.params.size() > 1) { | |||
fCompressed = (request.params[1].get_str() == "true"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use new ParseBoolV
instead (introduced in #2211 ).
src/rpc/masternode.cpp
Outdated
@@ -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: boolean, optional, default=false) generate compressed privkey\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe , optional param: 'compressed' - (boolean, optional, default=false) generate compressed privkey
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works.
Thanks for the tip! The new method seems to work perfectly for this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
- Add `compressed` parameter - Related to dashpay/dash#2232
- Add `compressed` parameter - Related to dashpay/dash#2232
* add compressed option to `masternode genkey` * use ParseBoolV method * adjust help message for masternode genkey
This allows anyone to generate / display compressed private keys using
masternode genkey
. Prior to this change only the uncompressed format is displayed.I don't like the "string that looks like bool" option but I've tried and unsure how else to get this to a true bool since
genkey
is a subcommand. Might have to change the help text to reflect this, I'm up for suggestions.