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

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>

riordant added some commits Jul 30, 2019

@reubenyap reubenyap added the bug label Aug 1, 2019

@reubenyap reubenyap added this to the v0.13.8.3 milestone Aug 1, 2019

@reubenyap reubenyap added this to Needs review in Zcoin Core via automation Aug 1, 2019

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

This comment has been minimized.

Copy link
@a-bezrukov

a-bezrukov Aug 1, 2019

Contributor

Same here

This comment has been minimized.

Copy link
@riordant

riordant Aug 1, 2019

Author Contributor

Could you clarify what you mean here?

This comment has been minimized.

Copy link
@a-bezrukov

a-bezrukov Aug 1, 2019

Contributor

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

This comment has been minimized.

Copy link
@levonpetrosyan93

levonpetrosyan93 Aug 1, 2019

Collaborator

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

This comment has been minimized.

Copy link
@levonpetrosyan93

levonpetrosyan93 Aug 1, 2019

Collaborator

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;

This comment has been minimized.

Copy link
@a-bezrukov

a-bezrukov Aug 1, 2019

Contributor

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

Zcoin Core automation moved this from Needs review to Reviewer approved Aug 1, 2019

@levonpetrosyan93 levonpetrosyan93 merged commit 53fb75c into master Aug 1, 2019

1 of 3 checks passed

LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No code changes detected
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details

Zcoin Core automation moved this from Reviewer approved to Done Aug 1, 2019

@reubenyap reubenyap deleted the logging branch Aug 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4 participants
You can’t perform that action at this time.