Skip to content
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

Add RPC function to regenerate mint pool if incorrect indexes used #566

Merged
merged 7 commits into from
Aug 1, 2019

Conversation

riordant
Copy link
Contributor

@riordant riordant commented Aug 1, 2019

PR intention

  • FIxes an issue where wallets, generated with HD mint prior to 0.13.8.2, have mints that are always stuck in "pending" on the Sigma page. This is due to incorrect indexes being generated for the mint pool database functions in the 0.13.8.1 release. The fix is simply to regenerate the mint pool from the known values, and add with the correct indexes.

  • Also adds increased logging level generally for HD mint code.

Code changes brief

  • Add RPC function regeneratemintpool
  • Modification of RegenerateMintPoolEntry to return a uint256 pair - <hashPubcoin, hashSerial>

src/hdmint/wallet.cpp Outdated Show resolved Hide resolved
{
bool fFound = false;
for(auto serialPubcoinPair : serialPubcoinPairs){
GroupElement pubcoin = serialPubcoinPair.second;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you clarify what you mean here?

Copy link
Contributor

Choose a reason for hiding this comment

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

pubcoin is a copy now. I think making it GroupElement const & pubcoin = serialPubcoinPair.second will be better performance-wise.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it can be like this const GroupElement& pubcoin.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will be more readable if we keep this line, only make it const reference.

{
bool fFound = false;
for(auto serialPubcoinPair : serialPubcoinPairs){
GroupElement pubcoin = serialPubcoinPair.second;
Copy link
Contributor

Choose a reason for hiding this comment

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

pubcoin is a copy now. I think making it GroupElement const & pubcoin = serialPubcoinPair.second will be better performance-wise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants