diff --git a/lib/mining/cpuminer.js b/lib/mining/cpuminer.js index 07e9aedb..a869f0d6 100644 --- a/lib/mining/cpuminer.js +++ b/lib/mining/cpuminer.js @@ -98,6 +98,7 @@ CPUMiner.prototype._close = co(function* close() { */ CPUMiner.prototype.start = function start() { + assert(!this.running, 'Miner is already running.'); this._start().catch(util.nop); }; @@ -206,7 +207,7 @@ CPUMiner.prototype.stop = co(function* stop() { * @returns {Promise} */ -CPUMiner.prototype.stop = co(function* stop() { +CPUMiner.prototype._stop = co(function* _stop() { if (!this.running) return;