Browse Source

fix mining in tests

cl-refactor
CJentzsch 10 years ago
parent
commit
f35a5ca84d
  1. 2
      libethcore/Ethash.cpp
  2. 2
      libethcore/Miner.h

2
libethcore/Ethash.cpp

@ -142,7 +142,7 @@ void Ethash::CPUMiner::workLoop()
WorkPackage w = work();
EthashAux::FullType dag;
while (!shouldStop() && !(dag = EthashAux::full(w.seedHash)))
while (!shouldStop() && !(dag = EthashAux::full(w.seedHash, true)))
this_thread::sleep_for(chrono::milliseconds(500));
h256 boundary = w.boundary;

2
libethcore/Miner.h

@ -44,7 +44,7 @@ struct MiningProgress
// MiningProgress& operator+=(MiningProgress const& _mp) { hashes += _mp.hashes; ms = std::max(ms, _mp.ms); return *this; }
uint64_t hashes = 0; ///< Total number of hashes computed.
uint64_t ms = 0; ///< Total number of milliseconds of mining thus far.
uint64_t rate() const { return hashes * 1000 / ms; }
uint64_t rate() const { return ms == 0 ? 0 : hashes * 1000 / ms; }
};
struct MineInfo: public MiningProgress {};

Loading…
Cancel
Save