Browse Source

Trigger dag creation prior to mining until threading on windows is sorted. Delete miner when returning early from gpu miner doWork so that in the event that abort is called prior to miner initializing, miner is still initialized.

cl-refactor
subtly 10 years ago
parent
commit
e7a0b94786
  1. 5
      ethminer/main.cpp
  2. 3
      libethcore/Ethash.cpp

5
ethminer/main.cpp

@ -250,10 +250,11 @@ void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod)
cnote << "Getting work package...";
Json::Value v = rpc.eth_getWork();
h256 hh(v[0].asString());
if (hh != current.headerHash)
h256 newSeedHash(v[1].asString());
if (hh != current.headerHash && !!EthashAux::full(newSeedHash, true))
{
current.headerHash = hh;
current.seedHash = h256(v[1].asString());
current.seedHash = newSeedHash;
current.boundary = h256(fromHex(v[2].asString()), h256::AlignRight);
cnote << "Got work package:";
cnote << " Header-hash:" << current.headerHash.hex();

3
libethcore/Ethash.cpp

@ -319,7 +319,10 @@ void Ethash::GPUMiner::workLoop()
if ((dag = EthashAux::full(w.seedHash, false)))
break;
if (shouldStop())
{
delete m_miner;
return;
}
cnote << "Awaiting DAG";
this_thread::sleep_for(chrono::milliseconds(500));
}

Loading…
Cancel
Save