Removes the redudant wallet reference from WalletImpl.
// before:
std::shared_ptr<CWallet> m_shared_wallet;
CWallet& m_wallet;
// after
std::shared_ptr<CWallet> m_wallet;
Removes the redudant wallet reference from WalletImpl.
// before:
std::shared_ptr<CWallet> m_shared_wallet;
CWallet& m_wallet;
// after
std::shared_ptr<CWallet> m_wallet;
Suggested by @ryanofsky in #15195 (comment).
172 | - bool getPrivKey(const CKeyID& address, CKey& key) override { return m_wallet.GetKey(address, key); } 173 | - bool isSpendable(const CTxDestination& dest) override { return IsMine(m_wallet, dest) & ISMINE_SPENDABLE; } 174 | - bool haveWatchOnly() override { return m_wallet.HaveWatchOnly(); }; 175 | + bool getPubKey(const CKeyID& address, CPubKey& pub_key) override { return m_wallet->GetPubKey(address, pub_key); } 176 | + bool getPrivKey(const CKeyID& address, CKey& key) override { return m_wallet->GetKey(address, key); } 177 | + bool isSpendable(const CTxDestination& dest) override { return IsMine(*m_wallet.get(), dest) & ISMINE_SPENDABLE; }
Here and other places, this should change to *m_wallet instead of *m_wallet.get(). It's shorter, more readable, and potentially allows better error checking since the overloaded method can detect a null dereference.
Oh I forgot about that operator, thanks.
utACK 526c5670d6fd866dfa0fb17ff40356d6fd089262
utACK 53b310390cc72a034911a8d6236b472a22c62227
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
utACK 53b310390cc72a034911a8d6236b472a22c62227
utACK 53b310390cc72a034911a8d6236b472a22c62227