-
Notifications
You must be signed in to change notification settings - Fork 38.7k
wallet: Add GetBalances to calculate all balances #13637
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
|
A wallet with 20k transactions, this improves around 30% of the execution time. |
src/wallet/wallet.cpp
Outdated
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.
👀
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.
Heh
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.
BTW this is another experiment where many computations are deduped per wallet tx. Still WIP.
src/wallet/wallet.h
Outdated
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.
Could return WalletBalances instead to avoid having to pass a ton of args?
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.
Not sure, wouldn't it add cyclic dependency?
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. |
96fffac to
74c8ccf
Compare
The new method `CWallet::GetBalances` computes all balances in one iteration. It also avoids repetitive lock/unlock for each wallet transaction.
74c8ccf to
c32f356
Compare
| Needs rebase |
|
This introduces duplicate code which. Closing for now because I think a different refactor might make sense. |
The new method
CWallet::GetBalancescomputes all balances in one iteration.It also avoids repetitive lock/unlock for each wallet transaction.