Skip to content

Commit

Permalink
[wallet] [moveonly] Move LoadKeyPool to cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt authored and jnewbery committed Aug 2, 2017
1 parent cab8557 commit 2376bfc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 17 additions & 0 deletions src/wallet/wallet.cpp
Expand Up @@ -3240,6 +3240,23 @@ size_t CWallet::KeypoolCountExternalKeys()
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)
{
{
Expand Down
17 changes: 1 addition & 16 deletions src/wallet/wallet.h
Expand Up @@ -746,22 +746,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
}
}

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);
}
void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool);

// Map from Key ID (for regular keys) or Script ID (for watch-only keys) to
// key metadata.
Expand Down

0 comments on commit 2376bfc

Please sign in to comment.