Move GetSpendingKeyForPaymentAddress visitor into wallet.h

Also fixes it to not use the global pwalletMain.
This commit is contained in:
Jack Grigg
2018-08-04 12:06:05 +01:00
parent c53884d20a
commit e22c115e78
3 changed files with 50 additions and 36 deletions

View File

@@ -1319,4 +1319,16 @@ public:
bool operator()(const libzcash::InvalidEncoding& no) const;
};
class GetSpendingKeyForPaymentAddress : public boost::static_visitor<boost::optional<libzcash::SpendingKey>>
{
private:
CWallet *m_wallet;
public:
GetSpendingKeyForPaymentAddress(CWallet *wallet) : m_wallet(wallet) {}
boost::optional<libzcash::SpendingKey> operator()(const libzcash::SproutPaymentAddress &zaddr) const;
boost::optional<libzcash::SpendingKey> operator()(const libzcash::SaplingPaymentAddress &zaddr) const;
boost::optional<libzcash::SpendingKey> operator()(const libzcash::InvalidEncoding& no) const;
};
#endif // BITCOIN_WALLET_WALLET_H