Electroneum
ancestry_state_t Struct Reference
Collaboration diagram for ancestry_state_t:

Public Member Functions

 ancestry_state_t ()
 
template<typename t_archive >
void serialize (t_archive &a, const unsigned int ver)
 

Public Attributes

uint64_t height
 
std::unordered_map< crypto::hash, std::unordered_set< ancestor > > ancestry
 
std::unordered_map< ancestor, crypto::hashoutput_cache
 
std::unordered_map< crypto::hash, ::tx_data_ttx_cache
 
std::vector< cryptonote::blockblock_cache
 

Detailed Description

Definition at line 134 of file blockchain_ancestry.cpp.

Constructor & Destructor Documentation

◆ ancestry_state_t()

ancestry_state_t::ancestry_state_t ( )
inline

Definition at line 142 of file blockchain_ancestry.cpp.

142 : height(0) {}

Member Function Documentation

◆ serialize()

template<typename t_archive >
void ancestry_state_t::serialize ( t_archive &  a,
const unsigned int  ver 
)
inline

Definition at line 144 of file blockchain_ancestry.cpp.

145  {
146  a & height;
147  a & ancestry;
148  a & output_cache;
149  if (ver < 1)
150  {
151  std::unordered_map<crypto::hash, cryptonote::transaction> old_tx_cache;
152  a & old_tx_cache;
153  for (const auto i: old_tx_cache)
154  tx_cache.insert(std::make_pair(i.first, ::tx_data_t(i.second)));
155  }
156  else
157  {
158  a & tx_cache;
159  }
160  if (ver < 2)
161  {
162  std::unordered_map<uint64_t, cryptonote::block> old_block_cache;
163  a & old_block_cache;
164  block_cache.resize(old_block_cache.size());
165  for (const auto i: old_block_cache)
166  block_cache[i.first] = i.second;
167  }
168  else
169  {
170  a & block_cache;
171  }
172  }
std::unordered_map< ancestor, crypto::hash > output_cache
std::unordered_map< crypto::hash, std::unordered_set< ancestor > > ancestry
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
std::vector< cryptonote::block > block_cache
std::unordered_map< crypto::hash, ::tx_data_t > tx_cache

Member Data Documentation

◆ ancestry

std::unordered_map<crypto::hash, std::unordered_set<ancestor> > ancestry_state_t::ancestry

Definition at line 137 of file blockchain_ancestry.cpp.

◆ block_cache

std::vector<cryptonote::block> ancestry_state_t::block_cache

Definition at line 140 of file blockchain_ancestry.cpp.

◆ height

uint64_t ancestry_state_t::height

Definition at line 136 of file blockchain_ancestry.cpp.

◆ output_cache

std::unordered_map<ancestor, crypto::hash> ancestry_state_t::output_cache

Definition at line 138 of file blockchain_ancestry.cpp.

◆ tx_cache

std::unordered_map<crypto::hash, ::tx_data_t> ancestry_state_t::tx_cache

Definition at line 139 of file blockchain_ancestry.cpp.


The documentation for this struct was generated from the following file: