Return more information when adding a spending key

This commit is contained in:
Eirik Ogilvie-Wigley
2018-09-12 05:03:13 -06:00
parent fcab001b1e
commit 0f03de5536
3 changed files with 27 additions and 24 deletions

View File

@@ -1376,7 +1376,13 @@ public:
boost::optional<libzcash::SpendingKey> operator()(const libzcash::InvalidEncoding& no) const;
};
class AddSpendingKeyToWallet : public boost::static_visitor<bool>
enum SpendingKeyAddResult {
KeyAlreadyExists,
KeyAdded,
KeyNotAdded,
};
class AddSpendingKeyToWallet : public boost::static_visitor<SpendingKeyAddResult>
{
private:
CWallet *m_wallet;
@@ -1385,9 +1391,9 @@ public:
AddSpendingKeyToWallet(CWallet *wallet, const Consensus::Params &params) :
m_wallet(wallet), params(params) {}
bool operator()(const libzcash::SproutSpendingKey &sk) const;
bool operator()(const libzcash::SaplingExtendedSpendingKey &sk) const;
bool operator()(const libzcash::InvalidEncoding& no) const;
SpendingKeyAddResult operator()(const libzcash::SproutSpendingKey &sk) const;
SpendingKeyAddResult operator()(const libzcash::SaplingExtendedSpendingKey &sk) const;
SpendingKeyAddResult operator()(const libzcash::InvalidEncoding& no) const;
};