MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / LoadKeyPool

Method LoadKeyPool

src/wallet/wallet.cpp:3326–3345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3324}
3325
3326void 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
3347bool CWallet::TopUpKeyPool(unsigned int kpSize)
3348{

Callers 1

walletdb.cppFile · 0.80

Calls 5

maxFunction · 0.85
CKeyMetadataClass · 0.85
GetIDMethod · 0.80
insertMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected