| 1150 | } |
| 1151 | |
| 1152 | void 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 | |
| 1173 | bool LegacyScriptPubKeyMan::CanGenerateKeys() const |
| 1174 | { |
no test coverage detected