use miner start/stop without parameters sicne it seems to be causing issues with geth 1.4
This commit is contained in:
parent
faf626be93
commit
ae4591ea01
21
js/mine.js
21
js/mine.js
|
@ -36,7 +36,8 @@
|
||||||
var miner_obj = (admin.miner === undefined) ? miner : admin.miner;
|
var miner_obj = (admin.miner === undefined) ? miner : admin.miner;
|
||||||
|
|
||||||
if (config.mine_normally) {
|
if (config.mine_normally) {
|
||||||
miner_obj.start(config.threads);
|
//miner_obj.start(config.threads);
|
||||||
|
miner_obj.start();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +68,8 @@
|
||||||
console.log("== Account funded");
|
console.log("== Account funded");
|
||||||
|
|
||||||
blockWatcher.stopWatching();
|
blockWatcher.stopWatching();
|
||||||
miner_obj.stop(config.threads);
|
//miner_obj.stop(config.threads);
|
||||||
|
miner_obj.stop();
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -89,7 +91,8 @@
|
||||||
var last_mined_ms = Date.now();
|
var last_mined_ms = Date.now();
|
||||||
var timeout_set = false;
|
var timeout_set = false;
|
||||||
|
|
||||||
miner_obj.start(config.threads);
|
//miner_obj.start(config.threads);
|
||||||
|
miner_obj.start();
|
||||||
web3.eth.filter("latest").watch(function () {
|
web3.eth.filter("latest").watch(function () {
|
||||||
if ((config.mine_pending_txns && pendingTransactions()) || timeout_set) {
|
if ((config.mine_pending_txns && pendingTransactions()) || timeout_set) {
|
||||||
return;
|
return;
|
||||||
|
@ -109,13 +112,15 @@
|
||||||
next_block_in_ms = (config.interval_ms - ms_since_block);
|
next_block_in_ms = (config.interval_ms - ms_since_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
miner_obj.stop(config.threads);
|
//miner_obj.stop(config.threads);
|
||||||
|
miner_obj.stop();
|
||||||
console.log("== Looking for next block in " + next_block_in_ms + "ms");
|
console.log("== Looking for next block in " + next_block_in_ms + "ms");
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
console.log("== Looking for next block");
|
console.log("== Looking for next block");
|
||||||
timeout_set = false;
|
timeout_set = false;
|
||||||
miner_obj.start(config.threads);
|
//miner_obj.start(config.threads);
|
||||||
|
miner_obj.start();
|
||||||
}, next_block_in_ms);
|
}, next_block_in_ms);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -125,7 +130,8 @@
|
||||||
if (miner_obj.hashrate > 0) return;
|
if (miner_obj.hashrate > 0) return;
|
||||||
|
|
||||||
console.log("== Pending transactions! Looking for next block...");
|
console.log("== Pending transactions! Looking for next block...");
|
||||||
miner_obj.start(config.threads);
|
//miner_obj.start(config.threads);
|
||||||
|
miner_obj.start();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (config.mine_periodically) return;
|
if (config.mine_periodically) return;
|
||||||
|
@ -133,7 +139,8 @@
|
||||||
web3.eth.filter("latest").watch(function () {
|
web3.eth.filter("latest").watch(function () {
|
||||||
if (!pendingTransactions()) {
|
if (!pendingTransactions()) {
|
||||||
console.log("== No transactions left. Stopping miner...");
|
console.log("== No transactions left. Stopping miner...");
|
||||||
miner_obj.stop(config.threads);
|
//miner_obj.stop(config.threads);
|
||||||
|
miner_obj.stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue