diff options
author | MeshCollider <dobsonsa68@gmail.com> | 2019-04-11 21:29:33 +1200 |
---|---|---|
committer | MeshCollider <dobsonsa68@gmail.com> | 2019-04-11 21:29:59 +1200 |
commit | c536dfbcb00fb15963bf5d507b7017c241718bf6 (patch) | |
tree | 06db1d6480d72064c9017a4aae87df8efa963382 /src/wallet/wallet.h | |
parent | f6120d40d583d15dd2ad7e09446fda84ab516018 (diff) | |
parent | 78a2fb55c97fbc26f7b74c5b1fb999a2aff8ce88 (diff) |
Merge #15639: bitcoin-wallet tool: Drop libbitcoin_server.a dependency
78a2fb55c bitcoin-wallet tool: Drop libbitcoin_server.a dependency (Russell Yanofsky)
b874747b5 Remove access to node globals from wallet-linked code (Russell Yanofsky)
fbc6bb8e8 bitcoin-wallet tool: Drop MakeChain calls (Russell Yanofsky)
Pull request description:
Dropping the `bitcoin-wallet` dependency on `libbitcoin_server.a` ensures wallet code can't access node global state, avoiding bugs like https://github.com/bitcoin/bitcoin/pull/15557#discussion_r267735431
ACKs for commit 78a2fb:
jnewbery:
utACK 78a2fb55c97fbc26f7b74c5b1fb999a2aff8ce88. Nice work, Russ.
MarcoFalke:
utACK 78a2fb5
MeshCollider:
utACK https://github.com/bitcoin/bitcoin/pull/15639/commits/78a2fb55c97fbc26f7b74c5b1fb999a2aff8ce88
Tree-SHA512: ee6ea774f683b936bea66638211dd53c42b8316e1ef03dd58d12fb7ee3891432a43c5c149944173c1e2436aa756b672e1679c39fc10043792ac55cd4d8af2823
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 36c0e160dd..4cc6973802 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -704,7 +704,7 @@ private: bool AddWatchOnly(const CScript& dest) override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); /** Interface for accessing chain state. */ - interfaces::Chain& m_chain; + interfaces::Chain* m_chain; /** Wallet location which includes wallet name (see WalletLocation). */ WalletLocation m_location; @@ -767,7 +767,7 @@ public: unsigned int nMasterKeyMaxID = 0; /** Construct wallet with specified name and database implementation. */ - CWallet(interfaces::Chain& chain, const WalletLocation& location, std::unique_ptr<WalletDatabase> database) : m_chain(chain), m_location(location), database(std::move(database)) + CWallet(interfaces::Chain* chain, const WalletLocation& location, std::unique_ptr<WalletDatabase> database) : m_chain(chain), m_location(location), database(std::move(database)) { } @@ -795,7 +795,7 @@ public: std::unique_ptr<interfaces::Handler> m_chain_notifications_handler; /** Interface for accessing chain state. */ - interfaces::Chain& chain() const { return m_chain; } + interfaces::Chain& chain() const { assert(m_chain); return *m_chain; } const CWalletTx* GetWalletTx(const uint256& hash) const; |