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
Wallet: correctly deprecate accounts in getbalance, re-add minconf / include-watch-only #13461
Wallet: correctly deprecate accounts in getbalance, re-add minconf / include-watch-only #13461
Conversation
…nclude-watch-only
Weird, travis failed with
restarted job. |
Concept ACK - added 0.17 tag to avoid API breakage in major version |
I don't understand.
|
Note to reviewers: This pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
I've taken another look at this and I don't think that #9614 removed the ability to call Concept ACK fixing that regression and restoring the functionality to call However, note that calling This PR changes the API to allow cc @ryanofsky , who wrote that help text. |
@jnewbery AFAIK there is currently no "better" balance calculation if one wants to filter with watch-only & min-confirmation-count,... and I think keeping the old behaviour rather then removing it is preferable. But obviously the whole balance calculation and caching system is inefficient (I guess it'�s not buggy?) and needs probably a complete overhaul. |
I think it's ok to change the API so that |
I don't think there's a technical reason why CWallet::GetBalance couldn't support the same |
There is also CWallet::GetWatchOnlyBalance |
Added min/max conf filter for Not sure if this is better since the main goal of this PR is to avoid an API break in 0.17. Ping @sipa @ryanofsky |
Didn't look extremely close but it seems like 9bbd407 has a few issues:
I'm not sure if my original suggestion was unclear, unworkable, or just not good, but I wonder why this couldn't just forward Also, this is a minor point, but I think it would be clearer to use |
I think https://github.com/jnewbery/bitcoin/tree/fix_get_balance does what's required:
@ryanofsky - is that what you had in mind? @jonasschnelli - if you're happy with that branch, either take it here or let me know and I'll open a PR. |
Yes, changes from master...jnewbery:fix_get_balance are what I was suggesting. Some thoughts looking at code:
CAmount* cache = filter == ISMINE_SPENDABLE ? nAvailableCreditCached :
filter == ISMINE_WATCH_ONLY ? nAvailableWatchCreditCached :
nullptr; |
Thanks @ryanofsky . @jonasschnelli - if you're amenable, I'm happy to open a new PR for this. Also feel free to take my commits and address Russ's comments if you'd prefer. |
Closing in favour of https://github.com/jnewbery/bitcoin/commits/fix_get_balance |
It looks like that #9614 accidentally(?) dropped support for
min-conf
andwatch_only
ingetbalance()
.This PR tries to correctly deprecate accounts in
getbalance()
following the dummy-argument approach.