-
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
Fix edge case for IS (skip inputs that are too large) #1695
Conversation
src/wallet/wallet.cpp
Outdated
@@ -2451,6 +2451,11 @@ static void ApproximateBestSubset(vector<pair<CAmount, pair<const CWalletTx*,uns | |||
vfIncluded[i] = true; | |||
if (nTotal >= nTargetValue) | |||
{ | |||
if (fUseInstantSend && nTotal > sporkManager.GetSporkValue(SPORK_5_INSTANTSEND_MAX_VALUE)) { |
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.
It took me some time to understand what this actually does. As I understand it, it skips considering this input as candidate for the "best subset". If this is the intent, wouldn't it be better to just add if (nTotal + vValue[i].first > max) continue
at the beginning of the inner loop (after line 2441)?
EDIT: Also, all the randomization stuff is unimportant for too large IX inputs, because it's nevertheless invalid for IX. So it's more clear when it's outside of these ifs.
utACK |
1 similar comment
utACK |
dashpay#1695 introduced a fix for a instant send related edge case. Somehow the parameters got mixed up and fUseInstantSend was passed as "iterations".
…et (dashpay#1819) dashpay#1695 introduced a fix for a instant send related edge case. Somehow the parameters got mixed up and fUseInstantSend was passed as "iterations".
…et (dashpay#1819) dashpay#1695 introduced a fix for a instant send related edge case. Somehow the parameters got mixed up and fUseInstantSend was passed as "iterations".
Selecting huge inputs will make IS fail due to violation of spork threshold, we must exclude them from our set of available inputs for IS txes.