From 0f86635c09968c1d491abefea77da30852efdc29 Mon Sep 17 00:00:00 2001 From: Vijay Manikpuri <2348066+vijaydasmp@users.noreply.github.com> Date: Mon, 4 Apr 2022 03:56:52 +0530 Subject: [PATCH] Merge #16226: Move ismine to the wallet module (#4640) e61de6306fd89fe9aae90253062e7b1b20343f8a Change ismine to take a CWallet instead of CKeyStore (Andrew Chow) 7c611e20007bf5face34d33dffa26c8db67e29ec Move ismine to wallet module (Andrew Chow) Pull request description: `IsMine` isn't used outside of the wallet except for the tests. It also doesn't make sense to be outside of the wallet. This PR moves `IsMine` into the wallet module and for it to take a `CWallet` instead of `CKeyStore`. The test that used `IsMine` is also moved to the wallet tests. This is first [prerequisites](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Class-Structure-Changes#ismine) for the wallet structure changes. ACKs for commit e61de6: MarcoFalke: re-ACK e61de6306f (only change is rebase with git auto-merge) meshcollider: Very light code review ACK https://github.com/bitcoin/bitcoin/pull/16226/commits/e61de6306fd89fe9aae90253062e7b1b20343f8a Tree-SHA512: 1cb4ad12652aef7922ab7460c6d413e8b9d1855dca78c0a286ae49d5c0765bc7996c55f262c742001d434eb9bd4215dc2cc7aae1b371ee1a82d46b32c17e6341 Co-authored-by: MeshCollider --- src/Makefile.am | 4 +- src/Makefile.test.include | 3 +- src/interfaces/wallet.cpp | 4 +- src/interfaces/wallet.h | 5 +- src/qt/transactiondesc.cpp | 1 + src/qt/transactionrecord.cpp | 2 + src/test/multisig_tests.cpp | 1 - src/test/script_p2sh_tests.cpp | 3 - src/test/script_standard_tests.cpp | 188 ------------------------- src/{script => wallet}/ismine.cpp | 14 +- src/{script => wallet}/ismine.h | 14 +- src/wallet/test/ismine_tests.cpp | 216 +++++++++++++++++++++++++++++ src/wallet/wallet.h | 2 +- src/wallet/wallettool.h | 1 - 14 files changed, 241 insertions(+), 217 deletions(-) rename src/{script => wallet}/ismine.cpp (91%) rename src/{script => wallet}/ismine.h (78%) create mode 100644 src/wallet/test/ismine_tests.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 7ad284bc00380..2b93dd52c0168 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -273,7 +273,6 @@ BITCOIN_CORE_H = \ saltedhasher.h \ scheduler.h \ script/descriptor.h \ - script/ismine.h \ script/sigcache.h \ script/sign.h \ script/standard.h \ @@ -330,6 +329,7 @@ BITCOIN_CORE_H = \ wallet/crypter.h \ wallet/db.h \ wallet/fees.h \ + wallet/ismine.h \ wallet/load.h \ wallet/psbtwallet.h \ wallet/rpcwallet.h \ @@ -493,6 +493,7 @@ libcosanta_wallet_a_SOURCES = \ wallet/crypter.cpp \ wallet/db.cpp \ wallet/fees.cpp \ + wallet/ismine.cpp \ wallet/load.cpp \ wallet/psbtwallet.cpp \ wallet/rpcdump.cpp \ @@ -682,7 +683,6 @@ libcosanta_common_a_SOURCES = \ saltedhasher.cpp \ scheduler.cpp \ script/descriptor.cpp \ - script/ismine.cpp \ script/sign.cpp \ script/standard.cpp \ versionbitsinfo.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 7ef7b08ff9c7a..ac36420593010 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -216,7 +216,8 @@ BITCOIN_TESTS += \ wallet/test/wallet_tests.cpp \ wallet/test/wallet_crypto_tests.cpp \ wallet/test/coinselector_tests.cpp \ - wallet/test/init_tests.cpp + wallet/test/init_tests.cpp \ + wallet/test/ismine_tests.cpp BITCOIN_TEST_SUITE += \ wallet/test/wallet_test_fixture.cpp \ diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 2eb5fcb306132..ba1c16fa71e27 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -14,9 +14,6 @@ #include #include #include -#include -#include -#include