Rename SpendingKeyMap -> SproutSpendingKeyMap
This commit is contained in:
@@ -88,7 +88,7 @@ bool CBasicKeyStore::AddSpendingKey(const libzcash::SproutSpendingKey &sk)
|
|||||||
{
|
{
|
||||||
LOCK(cs_SpendingKeyStore);
|
LOCK(cs_SpendingKeyStore);
|
||||||
auto address = sk.address();
|
auto address = sk.address();
|
||||||
mapSpendingKeys[address] = sk;
|
mapSproutSpendingKeys[address] = sk;
|
||||||
mapNoteDecryptors.insert(std::make_pair(address, ZCNoteDecryption(sk.receiving_key())));
|
mapNoteDecryptors.insert(std::make_pair(address, ZCNoteDecryption(sk.receiving_key())));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public:
|
|||||||
typedef std::map<CKeyID, CKey> KeyMap;
|
typedef std::map<CKeyID, CKey> KeyMap;
|
||||||
typedef std::map<CScriptID, CScript > ScriptMap;
|
typedef std::map<CScriptID, CScript > ScriptMap;
|
||||||
typedef std::set<CScript> WatchOnlySet;
|
typedef std::set<CScript> WatchOnlySet;
|
||||||
typedef std::map<libzcash::SproutPaymentAddress, libzcash::SproutSpendingKey> SpendingKeyMap;
|
typedef std::map<libzcash::SproutPaymentAddress, libzcash::SproutSpendingKey> SproutSpendingKeyMap;
|
||||||
typedef std::map<libzcash::SproutPaymentAddress, libzcash::SproutViewingKey> ViewingKeyMap;
|
typedef std::map<libzcash::SproutPaymentAddress, libzcash::SproutViewingKey> ViewingKeyMap;
|
||||||
typedef std::map<libzcash::SproutPaymentAddress, ZCNoteDecryption> NoteDecryptorMap;
|
typedef std::map<libzcash::SproutPaymentAddress, ZCNoteDecryption> NoteDecryptorMap;
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ protected:
|
|||||||
KeyMap mapKeys;
|
KeyMap mapKeys;
|
||||||
ScriptMap mapScripts;
|
ScriptMap mapScripts;
|
||||||
WatchOnlySet setWatchOnly;
|
WatchOnlySet setWatchOnly;
|
||||||
SpendingKeyMap mapSpendingKeys;
|
SproutSpendingKeyMap mapSproutSpendingKeys;
|
||||||
ViewingKeyMap mapViewingKeys;
|
ViewingKeyMap mapViewingKeys;
|
||||||
NoteDecryptorMap mapNoteDecryptors;
|
NoteDecryptorMap mapNoteDecryptors;
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ public:
|
|||||||
bool result;
|
bool result;
|
||||||
{
|
{
|
||||||
LOCK(cs_SpendingKeyStore);
|
LOCK(cs_SpendingKeyStore);
|
||||||
result = (mapSpendingKeys.count(address) > 0);
|
result = (mapSproutSpendingKeys.count(address) > 0);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -178,8 +178,8 @@ public:
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
LOCK(cs_SpendingKeyStore);
|
LOCK(cs_SpendingKeyStore);
|
||||||
SpendingKeyMap::const_iterator mi = mapSpendingKeys.find(address);
|
SproutSpendingKeyMap::const_iterator mi = mapSproutSpendingKeys.find(address);
|
||||||
if (mi != mapSpendingKeys.end())
|
if (mi != mapSproutSpendingKeys.end())
|
||||||
{
|
{
|
||||||
skOut = mi->second;
|
skOut = mi->second;
|
||||||
return true;
|
return true;
|
||||||
@@ -205,8 +205,8 @@ public:
|
|||||||
setAddress.clear();
|
setAddress.clear();
|
||||||
{
|
{
|
||||||
LOCK(cs_SpendingKeyStore);
|
LOCK(cs_SpendingKeyStore);
|
||||||
SpendingKeyMap::const_iterator mi = mapSpendingKeys.begin();
|
SproutSpendingKeyMap::const_iterator mi = mapSproutSpendingKeys.begin();
|
||||||
while (mi != mapSpendingKeys.end())
|
while (mi != mapSproutSpendingKeys.end())
|
||||||
{
|
{
|
||||||
setAddress.insert((*mi).first);
|
setAddress.insert((*mi).first);
|
||||||
mi++;
|
mi++;
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ bool CCryptoKeyStore::SetCrypted()
|
|||||||
LOCK2(cs_KeyStore, cs_SpendingKeyStore);
|
LOCK2(cs_KeyStore, cs_SpendingKeyStore);
|
||||||
if (fUseCrypto)
|
if (fUseCrypto)
|
||||||
return true;
|
return true;
|
||||||
if (!(mapKeys.empty() && mapSpendingKeys.empty() && mapSaplingSpendingKeys.empty()))
|
if (!(mapKeys.empty() && mapSproutSpendingKeys.empty() && mapSaplingSpendingKeys.empty()))
|
||||||
return false;
|
return false;
|
||||||
fUseCrypto = true;
|
fUseCrypto = true;
|
||||||
return true;
|
return true;
|
||||||
@@ -476,9 +476,9 @@ bool CCryptoKeyStore::EncryptKeys(CKeyingMaterial& vMasterKeyIn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mapKeys.clear();
|
mapKeys.clear();
|
||||||
BOOST_FOREACH(SpendingKeyMap::value_type& mSpendingKey, mapSpendingKeys)
|
BOOST_FOREACH(SproutSpendingKeyMap::value_type& mSproutSpendingKey, mapSproutSpendingKeys)
|
||||||
{
|
{
|
||||||
const libzcash::SproutSpendingKey &sk = mSpendingKey.second;
|
const libzcash::SproutSpendingKey &sk = mSproutSpendingKey.second;
|
||||||
CSecureDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
CSecureDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
||||||
ss << sk;
|
ss << sk;
|
||||||
CKeyingMaterial vchSecret(ss.begin(), ss.end());
|
CKeyingMaterial vchSecret(ss.begin(), ss.end());
|
||||||
@@ -491,7 +491,7 @@ bool CCryptoKeyStore::EncryptKeys(CKeyingMaterial& vMasterKeyIn)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mapSpendingKeys.clear();
|
mapSproutSpendingKeys.clear();
|
||||||
//! Sapling key support
|
//! Sapling key support
|
||||||
BOOST_FOREACH(SaplingSpendingKeyMap::value_type& mSaplingSpendingKey, mapSaplingSpendingKeys)
|
BOOST_FOREACH(SaplingSpendingKeyMap::value_type& mSaplingSpendingKey, mapSaplingSpendingKeys)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ private:
|
|||||||
|
|
||||||
CKeyingMaterial vMasterKey;
|
CKeyingMaterial vMasterKey;
|
||||||
|
|
||||||
//! if fUseCrypto is true, mapKeys, mapSpendingKeys, and mapSaplingSpendingKeys must be empty
|
//! if fUseCrypto is true, mapKeys, mapSproutSpendingKeys, and mapSaplingSpendingKeys must be empty
|
||||||
//! if fUseCrypto is false, vMasterKey must be empty
|
//! if fUseCrypto is false, vMasterKey must be empty
|
||||||
bool fUseCrypto;
|
bool fUseCrypto;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user