Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
DescriptorCache Class Reference

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.
 
bool GetCachedParentExtPubKey (uint32_t key_exp_pos, CExtPubKey &xpub) const
 Retrieve a cached parent xpub.
 
void CacheDerivedExtPubKey (uint32_t key_exp_pos, uint32_t der_index, const CExtPubKey &xpub)
 Cache an xpub derived at an index.
 
bool GetCachedDerivedExtPubKey (uint32_t key_exp_pos, uint32_t der_index, CExtPubKey &xpub) const
 Retrieve a cached xpub derived at an index.
 
const ExtPubKeyMap GetCachedParentExtPubKeys () const
 Retrieve all cached parent xpubs.
 
const std::unordered_map< uint32_t, ExtPubKeyMapGetCachedDerivedExtPubKeys () const
 Retrieve all cached derived xpubs.
 

Private Attributes

std::unordered_map< uint32_t, ExtPubKeyMapm_derived_xpubs
 Map key expression index -> map of (key derivation index -> xpub)
 
ExtPubKeyMap m_parent_xpubs
 Map key expression index -> parent xpub.
 

Detailed Description

Cache for single descriptor's derived extended pubkeys.

Definition at line 19 of file descriptor.h.

Member Function Documentation

◆ CacheDerivedExtPubKey()

void DescriptorCache::CacheDerivedExtPubKey ( uint32_t  key_exp_pos,
uint32_t  der_index,
const CExtPubKey xpub 
)

Cache an xpub derived at an index.

Parameters
[in]key_exp_posPosition of the key expression within the descriptor
[in]der_indexDerivation index of the xpub
[in]xpubThe CExtPubKey to cache

Definition at line 1311 of file descriptor.cpp.

Here is the call graph for this function:

◆ CacheParentExtPubKey()

void DescriptorCache::CacheParentExtPubKey ( uint32_t  key_exp_pos,
const CExtPubKey xpub 
)

Cache a parent xpub.

Parameters
[in]key_exp_posPosition of the key expression within the descriptor
[in]xpubThe CExtPubKey to cache

Definition at line 1306 of file descriptor.cpp.

Here is the call graph for this function:

◆ GetCachedDerivedExtPubKey()

bool DescriptorCache::GetCachedDerivedExtPubKey ( uint32_t  key_exp_pos,
uint32_t  der_index,
CExtPubKey xpub 
) const

Retrieve a cached xpub derived at an index.

Parameters
[in]key_exp_posPosition of the key expression within the descriptor
[in]der_indexDerivation index of the xpub
[in]xpubThe CExtPubKey to get from cache

Definition at line 1328 of file descriptor.cpp.

Here is the call graph for this function:

◆ GetCachedDerivedExtPubKeys()

const std::unordered_map< uint32_t, ExtPubKeyMap > DescriptorCache::GetCachedDerivedExtPubKeys ( ) const

Retrieve all cached derived xpubs.

Definition at line 1348 of file descriptor.cpp.

◆ GetCachedParentExtPubKey()

bool DescriptorCache::GetCachedParentExtPubKey ( uint32_t  key_exp_pos,
CExtPubKey xpub 
) const

Retrieve a cached parent xpub.

Parameters
[in]key_exp_posPosition of the key expression within the descriptor
[in]xpubThe CExtPubKey to get from cache

Definition at line 1318 of file descriptor.cpp.

Here is the call graph for this function:

◆ GetCachedParentExtPubKeys()

const ExtPubKeyMap DescriptorCache::GetCachedParentExtPubKeys ( ) const

Retrieve all cached parent xpubs.

Definition at line 1343 of file descriptor.cpp.

Member Data Documentation

◆ m_derived_xpubs

std::unordered_map<uint32_t, ExtPubKeyMap> DescriptorCache::m_derived_xpubs
private

Map key expression index -> map of (key derivation index -> xpub)

Definition at line 22 of file descriptor.h.

◆ m_parent_xpubs

ExtPubKeyMap DescriptorCache::m_parent_xpubs
private

Map key expression index -> parent xpub.

Definition at line 24 of file descriptor.h.


The documentation for this class was generated from the following files: