-
Notifications
You must be signed in to change notification settings - Fork 714
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
Refactor CWallet::AvailableCoins method signature #1859
Refactor CWallet::AvailableCoins method signature #1859
Conversation
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.
This does not compile.
The signature of CreateTransaction
needs to be updated in WalletModel::prepareTransaction
too.
yeah, doing it. I forgot that my environment had qt disabled. |
d8c9e92
to
c712a46
Compare
updated. |
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.
Aside from a couple bugs, I am not sure about the concept.
It seems to make the code more complex, because these flags don't really belong to the coinControl object.
Most of the times these are used when CC is null.
And when coinControl is not null, and we have coins selected, then we don't care about specific flags because we simply want to skip everything except the selection, at this line:
if (fCoinsSelected && !coinControl->fAllowOtherInputs && !coinControl->IsSelected(COutPoint((*it).first, i)))
continue;
Essentially made this to be able to add more features and don't continue extending the method signature. It has so many arguments with default values that it's easy to call this method wrongly without noticing it. The two options to solve this: (1) use the CoinControl wrapper, (2) create a new struct for the extra arguments that we are passing one by one to I'm more inclined to the first one because the CoinControl was essentially built for that reason. Add certain coins filtering capabilities in a single object and not pass them as arguments (making the |
Well, the purpose of CCoinControl is to provide an interface to manage a set of outpoints ( Anyway the added complexity of (1) is kinda highlighted by these sneaky bugs on something that was supposed to be "purely an aesthetic improvement, no functional changes". So, yeah, I would definitely prefer (2) over (1). |
Indeed, good idea. That will make a nice speed difference in the tx creation process for users with lot of txs that manually selected the utxo to spend. #- Going with (2) for now then. It's more organized and readable. |
Closing this one, made a complete overhaul of the area in #1977 |
Purely an aesthetic improvement, no functional changes. Combining parameters that should had been coded into
CoinControl
wrapper class in the first place.