diff options
author | Matt Corallo <git@bluematt.me> | 2017-07-26 16:37:15 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-08-02 17:31:35 -0400 |
commit | 2376bfcf24a83c61e9bba9e12bc0fd0b044bdfc1 (patch) | |
tree | f1bb6b09bf2ea300084addc7ef614a0e6da43cd5 /src | |
parent | cab8557e3504c4b93796a7e196b288ffd061b9b4 (diff) |
[wallet] [moveonly] Move LoadKeyPool to cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet.cpp | 17 | ||||
-rw-r--r-- | src/wallet/wallet.h | 17 |
2 files changed, 18 insertions, 16 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 38f527faf4..2ef3299c27 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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) { { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 7ef2e6f1d8..631cfad5b6 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -746,22 +746,7 @@ public: } } - 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. |