Skip to content

Conversation

nmarley
Copy link

@nmarley nmarley commented Aug 19, 2018

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.

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see below

@@ -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");
Copy link

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 ).

@@ -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"
Copy link

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 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works.

@UdjinM6 UdjinM6 added this to the 12.4 milestone Aug 19, 2018
@nmarley
Copy link
Author

nmarley commented Aug 20, 2018

Thanks for the tip! The new method seems to work perfectly for this case.

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@UdjinM6 UdjinM6 merged commit 2997d6d into dashpay:develop Aug 21, 2018
@nmarley nmarley deleted the genkey-compressed branch August 21, 2018 22:02
thephez added a commit to thephez/dash-docs that referenced this pull request Oct 23, 2018
 - Add `compressed` parameter
 - Related to dashpay/dash#2232
thephez added a commit to dash-docs/dash-docs that referenced this pull request Nov 19, 2018
 - Add `compressed` parameter
 - Related to dashpay/dash#2232
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Apr 25, 2019
* add compressed option to `masternode genkey`

* use ParseBoolV method

* adjust help message for masternode genkey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants