MCPcopy Create free account
hub / github.com/ElementsProject/elements / LoadKeyPool

Method LoadKeyPool

src/wallet/scriptpubkeyman.cpp:1152–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1150}
1151
1152void LegacyScriptPubKeyMan::LoadKeyPool(int64_t nIndex, const CKeyPool &keypool)
1153{
1154 LOCK(cs_KeyStore);
1155 if (keypool.m_pre_split) {
1156 set_pre_split_keypool.insert(nIndex);
1157 } else if (keypool.fInternal) {
1158 setInternalKeyPool.insert(nIndex);
1159 } else {
1160 setExternalKeyPool.insert(nIndex);
1161 }
1162 m_max_keypool_index = std::max(m_max_keypool_index, nIndex);
1163 m_pool_key_to_index[keypool.vchPubKey.GetID()] = nIndex;
1164
1165 // If no metadata exists yet, create a default with the pool key's
1166 // creation time. Note that this may be overwritten by actually
1167 // stored metadata for that key later, which is fine.
1168 CKeyID keyid = keypool.vchPubKey.GetID();
1169 if (mapKeyMetadata.count(keyid) == 0)
1170 mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime);
1171}
1172
1173bool LegacyScriptPubKeyMan::CanGenerateKeys() const
1174{

Callers 1

walletdb.cppFile · 0.80

Calls 4

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

Tested by

no test coverage detected