From a4b5a6af8f984fcfdda8a07936039acc98b6b66f Mon Sep 17 00:00:00 2001 From: MeshCollider Date: Fri, 21 Jun 2019 19:58:18 +1200 Subject: [PATCH] Merge #16226: Move ismine to the wallet module 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 --- src/Makefile.am | 4 +- src/Makefile.test.include | 3 +- src/interfaces/wallet.cpp | 2 +- src/interfaces/wallet.h | 3 +- src/qt/transactiondesc.cpp | 1 + src/qt/transactionrecord.cpp | 2 + src/test/script_p2sh_tests.cpp | 3 - src/test/script_standard_tests.cpp | 188 --------------------- src/{script => wallet}/ismine.cpp | 13 +- src/{script => wallet}/ismine.h | 14 +- src/wallet/test/ismine_tests.cpp | 216 ++++++++++++++++++++++++ src/wallet/wallet.h | 2 +- test/lint/lint-circular-dependencies.sh | 1 + 13 files changed, 241 insertions(+), 211 deletions(-) rename src/{script => wallet}/ismine.cpp (92%) 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 0bc9600e51de..060847e69fa3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -269,7 +269,6 @@ BITCOIN_CORE_H = \ saltedhasher.h \ scheduler.h \ script/descriptor.h \ - script/ismine.h \ script/sigcache.h \ script/sign.h \ script/standard.h \ @@ -325,6 +324,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 \ @@ -485,6 +485,7 @@ libdash_wallet_a_SOURCES = \ wallet/crypter.cpp \ wallet/db.cpp \ wallet/fees.cpp \ + wallet/ismine.cpp \ wallet/load.cpp \ wallet/psbtwallet.cpp \ wallet/rpcdump.cpp \ @@ -661,7 +662,6 @@ libdash_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 a08053982eea..6e93cc05a5c8 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -236,7 +236,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 d3bcc3d03e99..7181c7018e5c 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -11,7 +11,6 @@ #include #include #include -#include