| 265 | } |
| 266 | |
| 267 | bool 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 |
| 290 | bool WalletBatch::WriteOnlineKey(const CPubKey& online_key) |
no test coverage detected