Removes the redudant wallet reference from WalletImpl
.
0// before:
1std::shared_ptr<CWallet> m_shared_wallet;
2CWallet& m_wallet;
3
4// after
5std::shared_ptr<CWallet> m_wallet;
Removes the redudant wallet reference from WalletImpl
.
0// before:
1std::shared_ptr<CWallet> m_shared_wallet;
2CWallet& m_wallet;
3
4// after
5std::shared_ptr<CWallet> m_wallet;
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; }
*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.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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.