Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
dev::eth::EthashAux Class Reference

#include <EthashAux.h>

Collaboration diagram for dev::eth::EthashAux:
[legend]

Classes

struct  FullAllocation
 
struct  LightAllocation
 

Public Types

using LightType = std::shared_ptr< LightAllocation >
 
using FullType = std::shared_ptr< FullAllocation >
 

Public Member Functions

 ~EthashAux ()
 

Static Public Member Functions

static EthashAuxget ()
 
static h256 seedHash (unsigned _number)
 
static uint64_t number (h256 const &_seedHash)
 
static uint64_t cacheSize (BlockHeader const &_header)
 
static uint64_t dataSize (uint64_t _blockNumber)
 
static LightType light (h256 const &_seedHash)
 
static unsigned computeFull (h256 const &_seedHash, bool _createIfMissing=true)
 Kicks off generation of DAG for _seedHash and. More...
 
static std::pair< uint64_t, unsigned > fullGeneratingProgress ()
 Information on the generation progress. More...
 
static FullType full (h256 const &_seedHash, bool _createIfMissing=false, std::function< int(unsigned)> const &_f=std::function< int(unsigned)>())
 Kicks off generation of DAG for _blocknumber and blocks until ready;. More...
 
static EthashProofOfWork::Result eval (h256 const &_seedHash, h256 const &_headerHash, Nonce const &_nonce)
 

Static Public Attributes

static const uint64_t NotGenerating = (uint64_t)-1
 

Private Member Functions

 EthashAux ()
 
void killCache (h256 const &_s)
 Kicks off generation of DAG for _blocknumber and blocks until ready;. More...
 

Private Attributes

SharedMutex x_lights
 
std::unordered_map< h256, std::shared_ptr< LightAllocation > > m_lights
 
Mutex x_fulls
 
std::condition_variable m_fullsChanged
 
std::unordered_map< h256, std::weak_ptr< FullAllocation > > m_fulls
 
FullType m_lastUsedFull
 
std::unique_ptr< std::thread > m_fullGenerator
 
uint64_t m_generatingFullNumber = NotGenerating
 
unsigned m_fullProgress
 
Mutex x_epochs
 
std::unordered_map< h256, unsigned > m_epochs
 
h256s m_seedHashes
 

Static Private Attributes

static EthashAuxs_this = nullptr
 

Detailed Description

Definition at line 40 of file EthashAux.h.

Member Typedef Documentation

Definition at line 68 of file EthashAux.h.

Definition at line 67 of file EthashAux.h.

Constructor & Destructor Documentation

EthashAux::~EthashAux ( )

Definition at line 47 of file EthashAux.cpp.

dev::eth::EthashAux::EthashAux ( )
inlineprivate

Definition at line 88 of file EthashAux.h.

Member Function Documentation

uint64_t EthashAux::cacheSize ( BlockHeader const &  _header)
static

Definition at line 58 of file EthashAux.cpp.

Here is the call graph for this function:

unsigned EthashAux::computeFull ( h256 const &  _seedHash,
bool  _createIfMissing = true 
)
static

Kicks off generation of DAG for _seedHash and.

Returns
false or
true if ready.

Definition at line 202 of file EthashAux.cpp.

Here is the caller graph for this function:

uint64_t EthashAux::dataSize ( uint64_t  _blockNumber)
static

Definition at line 63 of file EthashAux.cpp.

Here is the call graph for this function:

EthashProofOfWork::Result EthashAux::eval ( h256 const &  _seedHash,
h256 const &  _headerHash,
Nonce const &  _nonce 
)
static

Definition at line 250 of file EthashAux.cpp.

EthashAux::FullType EthashAux::full ( h256 const &  _seedHash,
bool  _createIfMissing = false,
std::function< int(unsigned)> const &  _f = std::function<int(unsigned)>() 
)
static

Kicks off generation of DAG for _blocknumber and blocks until ready;.

Returns
result or empty pointer if not existing and _createIfMissing is false.

Definition at line 176 of file EthashAux.cpp.

Here is the caller graph for this function:

static std::pair<uint64_t, unsigned> dev::eth::EthashAux::fullGeneratingProgress ( )
inlinestatic

Information on the generation progress.

Definition at line 81 of file EthashAux.h.

EthashAux * EthashAux::get ( )
static

Definition at line 51 of file EthashAux.cpp.

void EthashAux::killCache ( h256 const &  _s)
private

Kicks off generation of DAG for _blocknumber and blocks until ready;.

Returns
result.

Definition at line 113 of file EthashAux.cpp.

EthashAux::LightType EthashAux::light ( h256 const &  _seedHash)
static

Definition at line 119 of file EthashAux.cpp.

uint64_t EthashAux::number ( h256 const &  _seedHash)
static

Definition at line 92 of file EthashAux.cpp.

Here is the call graph for this function:

h256 EthashAux::seedHash ( unsigned  _number)
static

Definition at line 68 of file EthashAux.cpp.

Here is the call graph for this function:

Member Data Documentation

std::unordered_map<h256, unsigned> dev::eth::EthashAux::m_epochs
private

Definition at line 108 of file EthashAux.h.

std::unique_ptr<std::thread> dev::eth::EthashAux::m_fullGenerator
private

Definition at line 103 of file EthashAux.h.

unsigned dev::eth::EthashAux::m_fullProgress
private

Definition at line 105 of file EthashAux.h.

std::unordered_map<h256, std::weak_ptr<FullAllocation> > dev::eth::EthashAux::m_fulls
private

Definition at line 101 of file EthashAux.h.

std::condition_variable dev::eth::EthashAux::m_fullsChanged
private

Definition at line 100 of file EthashAux.h.

uint64_t dev::eth::EthashAux::m_generatingFullNumber = NotGenerating
private

Definition at line 104 of file EthashAux.h.

FullType dev::eth::EthashAux::m_lastUsedFull
private

Definition at line 102 of file EthashAux.h.

std::unordered_map<h256, std::shared_ptr<LightAllocation> > dev::eth::EthashAux::m_lights
private

Definition at line 97 of file EthashAux.h.

h256s dev::eth::EthashAux::m_seedHashes
private

Definition at line 109 of file EthashAux.h.

const uint64_t dev::eth::EthashAux::NotGenerating = (uint64_t)-1
static

Definition at line 77 of file EthashAux.h.

EthashAux * dev::eth::EthashAux::s_this = nullptr
staticprivate

Definition at line 94 of file EthashAux.h.

Mutex dev::eth::EthashAux::x_epochs
private

Definition at line 107 of file EthashAux.h.

Mutex dev::eth::EthashAux::x_fulls
private

Definition at line 99 of file EthashAux.h.

SharedMutex dev::eth::EthashAux::x_lights
private

Definition at line 96 of file EthashAux.h.


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