Add support for spending keys to the basic key store

This commit is contained in:
Jack Grigg
2016-08-09 13:34:58 +12:00
parent a8270035c0
commit 7c929cf5bc
7 changed files with 96 additions and 5 deletions

View File

@@ -23,6 +23,10 @@ bool CKeyStore::AddKey(const CKey &key) {
return AddKeyPubKey(key, key.GetPubKey());
}
bool CKeyStore::AddSpendingKey(const libzcash::SpendingKey &key) {
return AddSpendingKeyPaymentAddress(key, key.address());
}
bool CBasicKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey)
{
LOCK(cs_KeyStore);
@@ -83,3 +87,10 @@ bool CBasicKeyStore::HaveWatchOnly() const
LOCK(cs_KeyStore);
return (!setWatchOnly.empty());
}
bool CBasicKeyStore::AddSpendingKeyPaymentAddress(const libzcash::SpendingKey& key, const libzcash::PaymentAddress &address)
{
LOCK(cs_KeyStore);
mapSpendingKeys[address] = key;
return true;
}