Browse Source

Merge pull request #2262 from LefterisJP/ethash_aux_race_condition

Potential fix for EthashAux race condition
cl-refactor
Gav Wood 10 years ago
parent
commit
f50674d7e1
  1. 7
      libethcore/EthashAux.cpp
  2. 2
      libethcore/EthashAux.h

7
libethcore/EthashAux.cpp

@ -49,6 +49,13 @@ EthashAux::~EthashAux()
{
}
EthashAux* EthashAux::get()
{
static std::once_flag flag;
std::call_once(flag, []{s_this = new EthashAux();});
return s_this;
}
uint64_t EthashAux::cacheSize(BlockInfo const& _header)
{
return ethash_get_cachesize((uint64_t)_header.number);

2
libethcore/EthashAux.h

@ -38,7 +38,7 @@ class EthashAux
public:
~EthashAux();
static EthashAux* get() { if (!s_this) s_this = new EthashAux(); return s_this; }
static EthashAux* get();
struct LightAllocation
{

Loading…
Cancel
Save