aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-10-07 14:11:34 -0400
committerAndrew Chow <achow101-github@achow101.com>2019-10-25 19:20:24 -0400
commitf201ba59ffd2e071a36a688b80d2cff9a9c44bb2 (patch)
treec2edffe4fe20cc412961dd8c09f8f8b16355a355 /src/qt/test
parent6702048f91089d7a565e5ca5f7c8dcd2ca405a85 (diff)
Refactor: Split up CWallet and LegacyScriptPubKeyMan and classes
This moves CWallet members and methods dealing with keys to a new LegacyScriptPubKeyMan class, and updates calling code to reference the new class instead of CWallet. Most of the changes are simple text replacements and variable substitutions easily verified with: git log -p -n1 -U0 --word-diff-regex=. The only nontrivial chunk of code added is the new LegacyScriptPubKeyMan class declaration, but this code isn't new and is just selectively copied and moved from the previous CWallet class declaration. This can be verified with: git log -p -n1 --color-moved=dimmed_zebra src/wallet/scriptpubkeyman.h src/wallet/wallet.h or git diff HEAD~1:src/wallet/wallet.h HEAD:src/wallet/scriptpubkeyman.h This commit does not change behavior.
Diffstat (limited to 'src/qt/test')
-rw-r--r--src/qt/test/wallettests.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp
index eea874c0d4..379bd8af88 100644
--- a/src/qt/test/wallettests.cpp
+++ b/src/qt/test/wallettests.cpp
@@ -138,9 +138,11 @@ void TestGUI()
bool firstRun;
wallet->LoadWallet(firstRun);
{
+ auto spk_man = wallet->GetLegacyScriptPubKeyMan();
LOCK(wallet->cs_wallet);
+ AssertLockHeld(spk_man->cs_wallet);
wallet->SetAddressBook(GetDestinationForKey(test.coinbaseKey.GetPubKey(), wallet->m_default_address_type), "", "receive");
- wallet->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey());
+ spk_man->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey());
}
{
auto locked_chain = wallet->chain().lock();