-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
|
||
while (nStep < nStepsMax) { | ||
for (const auto& pair: vecPSInOutPairsIn) { | ||
if (pair.second.nRounds < nMinRounds || pair.second.nRounds > nMaxRounds) { |
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.
... pair.second.nRounds >= nMaxRounds ...
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.
Fixed by #2277
src/privatesend-client.cpp
Outdated
std::vector< std::pair<CTxDSIn, CTxOut> > vecPSInOutPairs, vecPSInOutPairsTmp; | ||
|
||
if (!SelectDenominate(strError, vecPSInOutPairs)) { | ||
LogPrintf("CPrivateSendClientSession::SubmitDenominate -- SelectDenominate failed\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.
... SelectDenominate failed, error: %s\n", strError);
src/privatesend-client.cpp
Outdated
} | ||
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) { |
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.
Same 3 checks at the beginning of SelectDenominate. Redundant here?
7fccdff
to
9bf753c
Compare
9bf753c
to
938af06
Compare
rebased, pls review |
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.
utACK
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.
utACK
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.