-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Wallet: "listreceivedby*" fix #30972
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
base: master
Are you sure you want to change the base?
Wallet: "listreceivedby*" fix #30972
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/30972. ReviewsSee the guideline for information on the review process. ConflictsNo conflicts as of last run. |
🚧 At least one of the CI tasks failed. HintsMake sure to run all tests locally, according to the documentation. The failure may happen due to a number of reasons, for example:
Leave a comment here, if you need help tracking down a confusing failure. |
Co-authored-by: Andreas Kouloumos <[email protected]>
Co-authored-by: Andreas Kouloumos <[email protected]>
209303b
to
a35115f
Compare
Lgtm I ran the unit test and functional test (without bdb) and all pass. |
LOCK(wallet.cs_wallet); | ||
if (!wallet.IsMine(address)) return; // no send addresses | ||
|
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.
Since the mapTally
loading procedure already performs the IsMine
check, we could use that instead of executing it again for the addresses that received some coins.
In other words, if an element exists in mapTally
, we can be certain that everything inside it belongs to the wallet.
So, ideally, we could decouple the mapTally
existence check from the "include empty" check (the one that is just below this line), which would avoid this second IsMine()
call for the non-empty addresses (we would need to execute it for the addresses that have no associated value in mapTally
).
Fixes #16159,
This PR builds on #25973, fixing
listreceivedby*
RPCs by filtering outsend
addresses usingIsMine
(see #25973 (comment)). It also breaks down thelistreceivedby
tests into subtests and adds a test to verify 'listreceivedby*' does not returnsend
addresses