Bitcoin Core 28.99.0
P2P Digital Currency
|
Cache for single descriptor's derived extended pubkeys. More...
#include <descriptor.h>
Public Member Functions | |
void | CacheParentExtPubKey (uint32_t key_exp_pos, const CExtPubKey &xpub) |
Cache a parent xpub. More... | |
bool | GetCachedParentExtPubKey (uint32_t key_exp_pos, CExtPubKey &xpub) const |
Retrieve a cached parent xpub. More... | |
void | CacheDerivedExtPubKey (uint32_t key_exp_pos, uint32_t der_index, const CExtPubKey &xpub) |
Cache an xpub derived at an index. More... | |
bool | GetCachedDerivedExtPubKey (uint32_t key_exp_pos, uint32_t der_index, CExtPubKey &xpub) const |
Retrieve a cached xpub derived at an index. More... | |
void | CacheLastHardenedExtPubKey (uint32_t key_exp_pos, const CExtPubKey &xpub) |
Cache a last hardened xpub. More... | |
bool | GetCachedLastHardenedExtPubKey (uint32_t key_exp_pos, CExtPubKey &xpub) const |
Retrieve a cached last hardened xpub. More... | |
ExtPubKeyMap | GetCachedParentExtPubKeys () const |
Retrieve all cached parent xpubs. More... | |
std::unordered_map< uint32_t, ExtPubKeyMap > | GetCachedDerivedExtPubKeys () const |
Retrieve all cached derived xpubs. More... | |
ExtPubKeyMap | GetCachedLastHardenedExtPubKeys () const |
Retrieve all cached last hardened xpubs. More... | |
DescriptorCache | MergeAndDiff (const DescriptorCache &other) |
Combine another DescriptorCache into this one. More... | |
Private Attributes | |
std::unordered_map< uint32_t, ExtPubKeyMap > | m_derived_xpubs |
Map key expression index -> map of (key derivation index -> xpub) More... | |
ExtPubKeyMap | m_parent_xpubs |
Map key expression index -> parent xpub. More... | |
ExtPubKeyMap | m_last_hardened_xpubs |
Map key expression index -> last hardened xpub. More... | |
Cache for single descriptor's derived extended pubkeys.
Definition at line 19 of file descriptor.h.
void DescriptorCache::CacheDerivedExtPubKey | ( | uint32_t | key_exp_pos, |
uint32_t | der_index, | ||
const CExtPubKey & | xpub | ||
) |
Cache an xpub derived at an index.
[in] | key_exp_pos | Position of the key expression within the descriptor |
[in] | der_index | Derivation index of the xpub |
[in] | xpub | The CExtPubKey to cache |
Definition at line 2412 of file descriptor.cpp.
void DescriptorCache::CacheLastHardenedExtPubKey | ( | uint32_t | key_exp_pos, |
const CExtPubKey & | xpub | ||
) |
Cache a last hardened xpub.
[in] | key_exp_pos | Position of the key expression within the descriptor |
[in] | xpub | The CExtPubKey to cache |
Definition at line 2418 of file descriptor.cpp.
void DescriptorCache::CacheParentExtPubKey | ( | uint32_t | key_exp_pos, |
const CExtPubKey & | xpub | ||
) |
Cache a parent xpub.
[in] | key_exp_pos | Position of the key expression within the descriptor |
[in] | xpub | The CExtPubKey to cache |
Definition at line 2407 of file descriptor.cpp.
bool DescriptorCache::GetCachedDerivedExtPubKey | ( | uint32_t | key_exp_pos, |
uint32_t | der_index, | ||
CExtPubKey & | xpub | ||
) | const |
Retrieve a cached xpub derived at an index.
[in] | key_exp_pos | Position of the key expression within the descriptor |
[in] | der_index | Derivation index of the xpub |
[out] | xpub | The CExtPubKey to get from cache |
Definition at line 2431 of file descriptor.cpp.
std::unordered_map< uint32_t, ExtPubKeyMap > DescriptorCache::GetCachedDerivedExtPubKeys | ( | ) | const |
Retrieve all cached derived xpubs.
Definition at line 2495 of file descriptor.cpp.
bool DescriptorCache::GetCachedLastHardenedExtPubKey | ( | uint32_t | key_exp_pos, |
CExtPubKey & | xpub | ||
) | const |
Retrieve a cached last hardened xpub.
[in] | key_exp_pos | Position of the key expression within the descriptor |
[out] | xpub | The CExtPubKey to get from cache |
Definition at line 2441 of file descriptor.cpp.
ExtPubKeyMap DescriptorCache::GetCachedLastHardenedExtPubKeys | ( | ) | const |
Retrieve all cached last hardened xpubs.
Definition at line 2500 of file descriptor.cpp.
bool DescriptorCache::GetCachedParentExtPubKey | ( | uint32_t | key_exp_pos, |
CExtPubKey & | xpub | ||
) | const |
Retrieve a cached parent xpub.
[in] | key_exp_pos | Position of the key expression within the descriptor |
[out] | xpub | The CExtPubKey to get from cache |
Definition at line 2423 of file descriptor.cpp.
ExtPubKeyMap DescriptorCache::GetCachedParentExtPubKeys | ( | ) | const |
Retrieve all cached parent xpubs.
Definition at line 2490 of file descriptor.cpp.
DescriptorCache DescriptorCache::MergeAndDiff | ( | const DescriptorCache & | other | ) |
Combine another DescriptorCache into this one.
Returns a cache containing the items from the other cache unknown to current cache
Definition at line 2449 of file descriptor.cpp.
|
private |
Map key expression index -> map of (key derivation index -> xpub)
Definition at line 22 of file descriptor.h.
|
private |
Map key expression index -> last hardened xpub.
Definition at line 26 of file descriptor.h.
|
private |
Map key expression index -> parent xpub.
Definition at line 24 of file descriptor.h.