| 3324 | } |
| 3325 | |
| 3326 | void CWallet::LoadKeyPool(int64_t nIndex, const CKeyPool &keypool) |
| 3327 | { |
| 3328 | AssertLockHeld(cs_wallet); |
| 3329 | if (keypool.m_pre_split) { |
| 3330 | set_pre_split_keypool.insert(nIndex); |
| 3331 | } else if (keypool.fInternal) { |
| 3332 | setInternalKeyPool.insert(nIndex); |
| 3333 | } else { |
| 3334 | setExternalKeyPool.insert(nIndex); |
| 3335 | } |
| 3336 | m_max_keypool_index = std::max(m_max_keypool_index, nIndex); |
| 3337 | m_pool_key_to_index[keypool.vchPubKey.GetID()] = nIndex; |
| 3338 | |
| 3339 | // If no metadata exists yet, create a default with the pool key's |
| 3340 | // creation time. Note that this may be overwritten by actually |
| 3341 | // stored metadata for that key later, which is fine. |
| 3342 | CKeyID keyid = keypool.vchPubKey.GetID(); |
| 3343 | if (mapKeyMetadata.count(keyid) == 0) |
| 3344 | mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime); |
| 3345 | } |
| 3346 | |
| 3347 | bool CWallet::TopUpKeyPool(unsigned int kpSize) |
| 3348 | { |
no test coverage detected