-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet: Remove isminetypes #32523
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: Remove isminetypes #32523
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/32523. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
/home/runner/work/_temp/src/wallet/spend.cpp:474:12: error: calling function 'AvailableCoins' requires holding mutex 'wallet.cs_wallet' exclusively [-Werror,-Wthread-safety-analysis]
474 | return AvailableCoins(wallet, coinControl, /*feerate=*/ std::nullopt, params);
| ^
1 error generated. |
717afa2
to
75729d4
Compare
75729d4
to
6a77821
Compare
6a77821
to
f3ab751
Compare
Rebased, ready for review. |
This PR comes at a right time. I'm prioritising reviewing this one because it removes #27286: The new wallet unspents model in memory is using d637af8#diff-d41d68c5a65d67956c91b33ca86da7df1981d84a0b15b4a186deea566563fed5R372 |
d9ca23f
to
8fba2fa
Compare
I'm choosing to leave those comments in since they are specifically related to legacy wallet behavior |
utACK 8fba2fa |
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.
The is_mine output parameter is never used by any callers.
8fba2fa
to
65f1089
Compare
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.
ACK 620abe9 — built & tested locally; wallet tests passed. Behavior-preserving refactor; removing isminetype in favor of explicit booleans improves clarity.
Non-blocking nit: wallet_migration.py still references ISMINE_SPENDABLE / ISMINE_NO in comments. Functionally the tests use the boolean ismine; could you briefly explain why you kept the enum names in the comments, or consider changing them to ismine == True / ismine == False for consistency?
|
re-ACK 620abe9 |
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.
Concept ACK
In descriptor wallets, we consider all outputs to be spendable as we no longer have mixed mine and watchonly in a wallet. As such, COutput::spendable is meaningless and can be removed. Furthermore, CoinFilterParams::only_spendable can be removed as that was essentially checking for COutput::spendable. Lastly, AvailableCoinsListUnspent can also be removed as the wrapper is now only setting the feerate to std::nullopt which is trivial enough that a dedicated wrapper is not needed.
This isminetype is not a real isminetype as it is never returned by IsMine. This is only used for isminefilters in one function, which can be better represented with a bool parameter avoid_reuse.
Since the only remaining isminetypes are ISMINE_NO and ISMINE_SPENDABLE, this enum is now just a bool and can be removed. IsMine is changed to return a bool and any usage of isminetypes and isminefilters are changed to be the remaining ISMINE_SPENDABLE case.
65f1089
to
be776a1
Compare
ACK be776a1 |
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.
re-ACK be776a1
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.
reACK be776a1
reACK be776a1 |
crACK be776a1 |
Updated Namecoin-specific wallet code for the upstream removal of isminetype (bitcoin/bitcoin#32523).
The remaining isminetypes are
ISMINE_SPENDABLE
andISMINE_USED
.ISMINE_USED
is only used as a filter for caching balances and is never actually returned fromIsMine
. Since we do still want this behavior, This PR changes the caching to utilize bools and explicit members variables to account for the avoid_reuse case. This allows us to removeISMINE_USED
.ISMINE_SPENDABLE
andISMINE_NO
are the only things that are returned byIsMine
. This is a bool, so it can be replaced as such.After removing
ISMINE_USED
andISMINE_SPENDABLE
, we are able to remove isminetypes altogether.