Rename CryptedSpendingKeyMap -> CryptedSproutSpendingKeyMap
This commit is contained in:
@@ -274,7 +274,7 @@ public:
|
|||||||
|
|
||||||
typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;
|
typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;
|
||||||
typedef std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char> > > CryptedKeyMap;
|
typedef std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char> > > CryptedKeyMap;
|
||||||
typedef std::map<libzcash::SproutPaymentAddress, std::vector<unsigned char> > CryptedSpendingKeyMap;
|
typedef std::map<libzcash::SproutPaymentAddress, std::vector<unsigned char> > CryptedSproutSpendingKeyMap;
|
||||||
|
|
||||||
//! Sapling
|
//! Sapling
|
||||||
typedef std::map<libzcash::SaplingFullViewingKey, std::vector<unsigned char> > CryptedSaplingSpendingKeyMap;
|
typedef std::map<libzcash::SaplingFullViewingKey, std::vector<unsigned char> > CryptedSaplingSpendingKeyMap;
|
||||||
|
|||||||
@@ -217,11 +217,11 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
|
|||||||
if (fDecryptionThoroughlyChecked)
|
if (fDecryptionThoroughlyChecked)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CryptedSpendingKeyMap::const_iterator skmi = mapCryptedSpendingKeys.begin();
|
CryptedSproutSpendingKeyMap::const_iterator miSprout = mapCryptedSproutSpendingKeys.begin();
|
||||||
for (; skmi != mapCryptedSpendingKeys.end(); ++skmi)
|
for (; miSprout != mapCryptedSproutSpendingKeys.end(); ++miSprout)
|
||||||
{
|
{
|
||||||
const libzcash::SproutPaymentAddress &address = (*skmi).first;
|
const libzcash::SproutPaymentAddress &address = (*miSprout).first;
|
||||||
const std::vector<unsigned char> &vchCryptedSecret = (*skmi).second;
|
const std::vector<unsigned char> &vchCryptedSecret = (*miSprout).second;
|
||||||
libzcash::SproutSpendingKey sk;
|
libzcash::SproutSpendingKey sk;
|
||||||
if (!DecryptSproutSpendingKey(vMasterKeyIn, vchCryptedSecret, address, sk))
|
if (!DecryptSproutSpendingKey(vMasterKeyIn, vchCryptedSecret, address, sk))
|
||||||
{
|
{
|
||||||
@@ -376,7 +376,7 @@ bool CCryptoKeyStore::AddCryptedSpendingKey(const libzcash::SproutPaymentAddress
|
|||||||
if (!SetCrypted())
|
if (!SetCrypted())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
mapCryptedSpendingKeys[address] = vchCryptedSecret;
|
mapCryptedSproutSpendingKeys[address] = vchCryptedSecret;
|
||||||
mapNoteDecryptors.insert(std::make_pair(address, ZCNoteDecryption(rk)));
|
mapNoteDecryptors.insert(std::make_pair(address, ZCNoteDecryption(rk)));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -404,8 +404,8 @@ bool CCryptoKeyStore::GetSpendingKey(const libzcash::SproutPaymentAddress &addre
|
|||||||
if (!IsCrypted())
|
if (!IsCrypted())
|
||||||
return CBasicKeyStore::GetSpendingKey(address, skOut);
|
return CBasicKeyStore::GetSpendingKey(address, skOut);
|
||||||
|
|
||||||
CryptedSpendingKeyMap::const_iterator mi = mapCryptedSpendingKeys.find(address);
|
CryptedSproutSpendingKeyMap::const_iterator mi = mapCryptedSproutSpendingKeys.find(address);
|
||||||
if (mi != mapCryptedSpendingKeys.end())
|
if (mi != mapCryptedSproutSpendingKeys.end())
|
||||||
{
|
{
|
||||||
const std::vector<unsigned char> &vchCryptedSecret = (*mi).second;
|
const std::vector<unsigned char> &vchCryptedSecret = (*mi).second;
|
||||||
return DecryptSproutSpendingKey(vMasterKey, vchCryptedSecret, address, skOut);
|
return DecryptSproutSpendingKey(vMasterKey, vchCryptedSecret, address, skOut);
|
||||||
|
|||||||
@@ -128,10 +128,9 @@ class CCryptoKeyStore : public CBasicKeyStore
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CryptedKeyMap mapCryptedKeys;
|
CryptedKeyMap mapCryptedKeys;
|
||||||
CryptedSpendingKeyMap mapCryptedSpendingKeys;
|
CryptedSproutSpendingKeyMap mapCryptedSproutSpendingKeys;
|
||||||
|
|
||||||
CryptedSaplingSpendingKeyMap mapCryptedSaplingSpendingKeys;
|
CryptedSaplingSpendingKeyMap mapCryptedSaplingSpendingKeys;
|
||||||
|
|
||||||
CKeyingMaterial vMasterKey;
|
CKeyingMaterial vMasterKey;
|
||||||
|
|
||||||
//! if fUseCrypto is true, mapKeys and mapSpendingKeys must be empty
|
//! if fUseCrypto is true, mapKeys and mapSpendingKeys must be empty
|
||||||
@@ -212,7 +211,7 @@ public:
|
|||||||
LOCK(cs_SpendingKeyStore);
|
LOCK(cs_SpendingKeyStore);
|
||||||
if (!IsCrypted())
|
if (!IsCrypted())
|
||||||
return CBasicKeyStore::HaveSpendingKey(address);
|
return CBasicKeyStore::HaveSpendingKey(address);
|
||||||
return mapCryptedSpendingKeys.count(address) > 0;
|
return mapCryptedSproutSpendingKeys.count(address) > 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -225,8 +224,8 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setAddress.clear();
|
setAddress.clear();
|
||||||
CryptedSpendingKeyMap::const_iterator mi = mapCryptedSpendingKeys.begin();
|
CryptedSproutSpendingKeyMap::const_iterator mi = mapCryptedSproutSpendingKeys.begin();
|
||||||
while (mi != mapCryptedSpendingKeys.end())
|
while (mi != mapCryptedSproutSpendingKeys.end())
|
||||||
{
|
{
|
||||||
setAddress.insert((*mi).first);
|
setAddress.insert((*mi).first);
|
||||||
mi++;
|
mi++;
|
||||||
|
|||||||
Reference in New Issue
Block a user