Browse Source

Use straight homedirectory rather than Application Support.

cl-refactor
Gav Wood 10 years ago
parent
commit
a6f80e6f97
  1. 15
      libethcore/EthashAux.cpp

15
libethcore/EthashAux.cpp

@ -181,10 +181,18 @@ EthashAux::FullType EthashAux::full(h256 const& _seedHash, bool _createIfMissing
return ret; return ret;
} }
#define DEV_IF_THROWS(X) try { X; } catch (...)
unsigned EthashAux::computeFull(h256 const& _seedHash) unsigned EthashAux::computeFull(h256 const& _seedHash)
{ {
Guard l(get()->x_fulls); Guard l(get()->x_fulls);
uint64_t blockNumber = EthashAux::number(_seedHash); uint64_t blockNumber;
DEV_IF_THROWS(blockNumber = EthashAux::number(_seedHash))
{
return 0;
}
if (FullType ret = get()->m_fulls[_seedHash].lock()) if (FullType ret = get()->m_fulls[_seedHash].lock())
{ {
get()->m_lastUsedFull = ret; get()->m_lastUsedFull = ret;
@ -232,5 +240,8 @@ Ethash::Result EthashAux::eval(h256 const& _seedHash, h256 const& _headerHash, N
{ {
if (FullType dag = get()->m_fulls[_seedHash].lock()) if (FullType dag = get()->m_fulls[_seedHash].lock())
return dag->compute(_headerHash, _nonce); return dag->compute(_headerHash, _nonce);
return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce); DEV_IF_THROWS(return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce))
{
return Ethash::Result(~h256(), h256());
}
} }

Loading…
Cancel
Save