Move CWallet::setKeyPool to private section of CWallet

This commit is contained in:
Patrick Strateman
2016-08-01 17:14:40 -07:00
parent ea268747b6
commit e86eb71604
3 changed files with 21 additions and 11 deletions

View File

@@ -582,6 +582,8 @@ private:
CHDChain hdChain;
bool fFileBacked;
std::set<int64_t> setKeyPool;
public:
/*
* Main wallet lock.
@@ -594,7 +596,18 @@ public:
std::string strWalletFile;
std::set<int64_t> setKeyPool;
void LoadKeyPool(int nIndex, const CKeyPool &keypool)
{
setKeyPool.insert(nIndex);
// If no metadata exists yet, create a default with the pool key's
// creation time. Note that this may be overwritten by actually
// stored metadata for that key later, which is fine.
CKeyID keyid = keypool.vchPubKey.GetID();
if (mapKeyMetadata.count(keyid) == 0)
mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime);
}
std::map<CKeyID, CKeyMetadata> mapKeyMetadata;
typedef std::map<unsigned int, CMasterKey> MasterKeyMap;

View File

@@ -556,14 +556,8 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
ssKey >> nIndex;
CKeyPool keypool;
ssValue >> keypool;
pwallet->setKeyPool.insert(nIndex);
// If no metadata exists yet, create a default with the pool key's
// creation time. Note that this may be overwritten by actually
// stored metadata for that key later, which is fine.
CKeyID keyid = keypool.vchPubKey.GetID();
if (pwallet->mapKeyMetadata.count(keyid) == 0)
pwallet->mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime);
pwallet->LoadKeyPool(nIndex, keypool);
}
else if (strType == "version")
{