-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Bitcoin backport related to CWallet refactoring: bitcoin#17304, partial #10235 #4993
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
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
left a comment
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.
pls see 4919ff1f999b0cf527aa822750665d292ae684bb + 7bfa558ca79125c7e73851e733a2f2af5aca0cf1 + 3226adb5809b45d1d73a9557675b4e9ee2d7cd8f
2dbcab1 to
c1fbc8b
Compare
UdjinM6
left a comment
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.
LGTM, utACK
PastaPastaPasta
left a comment
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.
utACK for squash merge
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