mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
[wallet] [moveonly] Move LoadKeyPool to cpp
This commit is contained in:
parent
cab8557e35
commit
2376bfcf24
@ -3240,6 +3240,23 @@ size_t CWallet::KeypoolCountExternalKeys()
|
|||||||
return setExternalKeyPool.size();
|
return setExternalKeyPool.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CWallet::LoadKeyPool(int64_t nIndex, const CKeyPool &keypool)
|
||||||
|
{
|
||||||
|
if (keypool.fInternal) {
|
||||||
|
setInternalKeyPool.insert(nIndex);
|
||||||
|
} else {
|
||||||
|
setExternalKeyPool.insert(nIndex);
|
||||||
|
}
|
||||||
|
m_max_keypool_index = std::max(m_max_keypool_index, 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);
|
||||||
|
}
|
||||||
|
|
||||||
bool CWallet::TopUpKeyPool(unsigned int kpSize)
|
bool CWallet::TopUpKeyPool(unsigned int kpSize)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -746,22 +746,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool)
|
void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool);
|
||||||
{
|
|
||||||
if (keypool.fInternal) {
|
|
||||||
setInternalKeyPool.insert(nIndex);
|
|
||||||
} else {
|
|
||||||
setExternalKeyPool.insert(nIndex);
|
|
||||||
}
|
|
||||||
m_max_keypool_index = std::max(m_max_keypool_index, 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Map from Key ID (for regular keys) or Script ID (for watch-only keys) to
|
// Map from Key ID (for regular keys) or Script ID (for watch-only keys) to
|
||||||
// key metadata.
|
// key metadata.
|
||||||
|
Loading…
Reference in New Issue
Block a user