Bitcoin backport related to CWallet refactoring: bitcoin#17304, partial #10235#4993
Merged
PastaPastaPasta merged 21 commits intodashpay:developfrom Sep 20, 2022
Merged
Bitcoin backport related to CWallet refactoring: bitcoin#17304, partial #10235#4993PastaPastaPasta merged 21 commits intodashpay:developfrom
PastaPastaPasta merged 21 commits intodashpay:developfrom
Conversation
Can verify move-only with:
git log -p -n1 --color-moved
This commit is move-only and doesn't change code or affect behavior.
This commit does not change behavior.
This commit does not change behavior.
…ewDestination This commit does not change behavior.
…Metadata This commit does not change behavior.
SetWalletFlag is unused. Does not change any behavior
…HDSeed This commit does not change behavior.
…ScriptPubKeyMan ScriptPubKeyMan is only using UnsetWalletFlagWithDB to unset the blank wallet flag. Just make that it's own function and not expose the flag writing directly. This does not change behavior.
…::ImportScriptPubKeys This commit does not change behavior.
This commit does not change behavior.
Easier to review ignoring whitespace:
git log -p -n1 -w
This commit does not change behavior.
…InvolvingMe This commit does not change behavior.
This commit does not change behavior.
This commit does not change behavior.
This commit does not change behavior.
This commit does not change behavior.
```
wallet/wallet.cpp:4536:41: error: calling function 'GetTimeFirstKey' requires holding mutex 'spk_man->cs_wallet' exclusively [-Werror,-Wthread-safety-analysis]
int64_t time = spk_man->GetTimeFirstKey();
^
wallet/wallet.cpp:4570:106: error: calling function 'GetTimeFirstKey' requires holding mutex 'walletInstance->m_spk_man->cs_wallet' exclusively [-Werror,-Wthread-safety-analysis]
walletInstance->WalletLogPrintf("nTimeFirstKey = %u\n", walletInstance->m_spk_man->GetTimeFirstKey());
```
UdjinM6
requested changes
Sep 1, 2022
UdjinM6
left a comment
There was a problem hiding this comment.
pls see 4919ff1f999b0cf527aa822750665d292ae684bb + 7bfa558ca79125c7e73851e733a2f2af5aca0cf1 + 3226adb5809b45d1d73a9557675b4e9ee2d7cd8f
2dbcab1 to
c1fbc8b
Compare
PastaPastaPasta
approved these changes
Sep 20, 2022
Member
PastaPastaPasta
left a comment
There was a problem hiding this comment.
utACK for squash merge
5 tasks
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
What was done?
That is a next backport related to CWallet refactoring. It split to many commits (same as original pull request) for easier conflict resolving and code review, but should be squashed before merging.
✔️ Merge bitcoin#16227: Refactor CWallet's inheritance chain
✔️ Merge bitcoin#17260: Split some CWallet functions into new LegacyScriptPubKeyMan
✔️ Merge bitcoin#17300: LegacyScriptPubKeyMan code cleanups
✔️ Merge bitcoin#16237: Have the wallet give out destinations instead of keys
✔️ Merge bitcoin#16301: Use CWallet::Import* functions in all import* RPCs
✔️ Merge bitcoin#16383: rpcwallet: default include_watchonly to true for watchonly wallets
✔️ Merge bitcoin#16798: Refactor rawtransaction_util's SignTransaction to separate prevtx parsing
✔️ Merge bitcoin#16900: doc: Fix doxygen comment for SignTransaction in rpc/rawtransaction_util
↻ Merge bitcoin#17304: refactor: Move many functions into LegacyScriptPubKeyMan and further separate it from CWallet
☐ Merge bitcoin#17381: LegacyScriptPubKeyMan code cleanups
☐ Merge bitcoin#17371: Refactor: Require scriptPubKey to get wallet SigningProvider
☐ Merge bitcoin#17237: wallet: LearnRelatedScripts only if KeepDestination
☐ Merge bitcoin#17373: wallet: Various fixes and cleanup to keypool handling in LegacyScriptPubKeyMan and CWallet
☐ Merge bitcoin#17369: Refactor: Move encryption code between KeyMan and Wallet
☐ Merge bitcoin#17537: wallet: Cleanup and move opportunistic and superfluous TopUp()
☐ Merge bitcoin#17677: Activate watchonly wallet behavior for LegacySPKM only
☐ Merge bitcoin#17924: Bug: IsUsedDestination shouldn't use key id as script id for ScriptHash
☐ Merge bitcoin#17261: Make ScriptPubKeyMan an actual interface and the wallet to have multiple
☐ Merge bitcoin#18026: psbt_wallet_tests: use unique_ptr for GetSigningProvider
☐ Merge bitcoin#18067: wallet: Improve LegacyScriptPubKeyMan::CanProvide script recognition
☐ Merge bitcoin#18193: scripted-diff: Wallet: Rename incorrectly named *UsedDestination
Therefore 2 commits are skipped because code is not relevant:
commit bbc9e41
Merge: fba574c 152b0a0
Author: Wladimir J. van der Laan [email protected]
Date: Mon Nov 4 16:01:30 2019 +0100
How Has This Been Tested?
By running unit/functional tests.
Please, pay extra attention during code review to these 4 snippet:
EXCLUSIVE_LOCKS_REQUIREDor not? bitcoin does not have(even some other methods do)
Code seems correct, but I am not sure that is it right place to do it (code with bitcoin slightly different here)
Seems as it was missing in past but I am not 100% sure. Can anyone confirm it?
Breaking Changes
Seems compatible, should be none as underlying backport is a "refactor"
Checklist:
For repository code-owners and collaborators only