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

Move heavy coin selection out of the loop in SubmitDenominate #2274

Merged
merged 2 commits into from
Sep 15, 2018

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Sep 8, 2018

Have to refactor quite a bit of code but the functionality should stay the same (logic wise).

Includes #2270 , will rebase after it's merged.

@UdjinM6 UdjinM6 added this to the 12.4 milestone Sep 8, 2018

while (nStep < nStepsMax) {
for (const auto& pair: vecPSInOutPairsIn) {
if (pair.second.nRounds < nMinRounds || pair.second.nRounds > nMaxRounds) {

Choose a reason for hiding this comment

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

... pair.second.nRounds >= nMaxRounds ...

Copy link
Author

Choose a reason for hiding this comment

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

Fixed by #2277

std::vector< std::pair<CTxDSIn, CTxOut> > vecPSInOutPairs, vecPSInOutPairsTmp;

if (!SelectDenominate(strError, vecPSInOutPairs)) {
LogPrintf("CPrivateSendClientSession::SubmitDenominate -- SelectDenominate failed\n");

Choose a reason for hiding this comment

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

... SelectDenominate failed, error: %s\n", strError);

}
bool CPrivateSendClientSession::PrepareDenominate(int nMinRounds, int nMaxRounds, std::string& strErrorRet, const std::vector< std::pair<CTxDSIn, CTxOut> >& vecPSInOutPairsIn, std::vector< std::pair<CTxDSIn, CTxOut> >& vecPSInOutPairsRet)
{
if (!pwalletMain) {

Choose a reason for hiding this comment

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

Same 3 checks at the beginning of SelectDenominate. Redundant here?

@UdjinM6 UdjinM6 changed the title Move heavy coin selection out of the loop in SubmitDenominate [WIP] Move heavy coin selection out of the loop in SubmitDenominate Sep 9, 2018
@UdjinM6
Copy link
Author

UdjinM6 commented Sep 11, 2018

rebased, pls review

@UdjinM6 UdjinM6 changed the title [WIP] Move heavy coin selection out of the loop in SubmitDenominate Move heavy coin selection out of the loop in SubmitDenominate Sep 11, 2018
Copy link

@gladcow gladcow left a comment

Choose a reason for hiding this comment

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

utACK

Copy link

@nmarley nmarley left a comment

Choose a reason for hiding this comment

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

utACK

@UdjinM6 UdjinM6 merged commit d192d64 into dashpay:develop Sep 15, 2018
@UdjinM6 UdjinM6 deleted the moveheavypartsout branch November 26, 2020 13:27
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.

None yet

4 participants