cpuminer: fix stop.

This commit is contained in:
Christopher Jeffrey 2017-03-14 17:40:34 -07:00
parent 010267e78e
commit ede25e8c9e
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -98,6 +98,7 @@ CPUMiner.prototype._close = co(function* close() {
*/ */
CPUMiner.prototype.start = function start() { CPUMiner.prototype.start = function start() {
assert(!this.running, 'Miner is already running.');
this._start().catch(util.nop); this._start().catch(util.nop);
}; };
@ -206,7 +207,7 @@ CPUMiner.prototype.stop = co(function* stop() {
* @returns {Promise} * @returns {Promise}
*/ */
CPUMiner.prototype.stop = co(function* stop() { CPUMiner.prototype._stop = co(function* _stop() {
if (!this.running) if (!this.running)
return; return;