-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet: Replace GetBalance()
logic with AvailableCoins()
#26756
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsReviewers, 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. |
ca8dbf6
to
7215a05
Compare
This allows `AvailableCoins()` to be used in multiple files without creating a circular dependency
Add to the `AvailableCoins()` function the ability to separate values by status and ownership of each coin.
7215a05
to
3a2bc11
Compare
Rebased. |
🐙 This pull request conflicts with the target branch and needs rebase. |
I think this will end up making |
I'd also prefer we stopped using A lot of bugs/strangeness in the wallet seems to come from the fact that we always need to iterate over a bunch of transactions to learn the state of our wallet. If we did track wallet state in one place, we could have well-scoped individual functions for specific tasks. |
Closing due to lack of interest in this approach. |
This PR proposes a solution for #26500 by changing the
AvailableCoins()
function to calculate values by status (TRUSTED
,UNTRUSTED_PENDING
andIMMATURE
) and ownership (MINE
,WATCH_ONLY
), eliminating theGetBalance()
logic.The downside is that the cache is no longer used. Not sure about the performance implication, but if the approach is OK, caching can also be used with this solution.
This approach also fixes the bug mentioned at the end of the
wallet_abandonconflict.py
file.