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

Method WriteDescriptorCacheItems

src/wallet/walletdb.cpp:267–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267bool WalletBatch::WriteDescriptorCacheItems(const uint256& desc_id, const DescriptorCache& cache)
268{
269 for (const auto& parent_xpub_pair : cache.GetCachedParentExtPubKeys()) {
270 if (!WriteDescriptorParentCache(parent_xpub_pair.second, desc_id, parent_xpub_pair.first)) {
271 return false;
272 }
273 }
274 for (const auto& derived_xpub_map_pair : cache.GetCachedDerivedExtPubKeys()) {
275 for (const auto& derived_xpub_pair : derived_xpub_map_pair.second) {
276 if (!WriteDescriptorDerivedCache(derived_xpub_pair.second, desc_id, derived_xpub_map_pair.first, derived_xpub_pair.first)) {
277 return false;
278 }
279 }
280 }
281 for (const auto& lh_xpub_pair : cache.GetCachedLastHardenedExtPubKeys()) {
282 if (!WriteDescriptorLastHardenedCache(lh_xpub_pair.second, desc_id, lh_xpub_pair.first)) {
283 return false;
284 }
285 }
286 return true;
287}
288
289// ELEMENTS: PAK and Blinding keys
290bool WalletBatch::WriteOnlineKey(const CPubKey& online_key)

Callers 2

TopUpMethod · 0.80

Tested by

no test coverage detected