Bitcoin Core  0.20.99
P2P Digital Currency
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. 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...
 
const ExtPubKeyMap GetCachedParentExtPubKeys () const
 Retrieve all cached parent xpubs. More...
 
const std::unordered_map< uint32_t, ExtPubKeyMapGetCachedDerivedExtPubKeys () const
 Retrieve all cached derived xpubs. More...
 

Private Attributes

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

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 1117 of file descriptor.cpp.

◆ 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 1112 of file descriptor.cpp.

◆ 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 1131 of file descriptor.cpp.

◆ GetCachedDerivedExtPubKeys()

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

Retrieve all cached derived xpubs.

Definition at line 1146 of file descriptor.cpp.

Here is the caller graph for this function:

◆ 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 1123 of file descriptor.cpp.

◆ GetCachedParentExtPubKeys()

const ExtPubKeyMap DescriptorCache::GetCachedParentExtPubKeys ( ) const

Retrieve all cached parent xpubs.

Definition at line 1141 of file descriptor.cpp.

Here is the caller graph for this function:

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: