Skip to content

Instantly share code, notes, and snippets.

web3.eth.filter("pending").watch(function() {
if (eth.mining) return;
console.log(new Date() + "-- Transactions detected, so starting mining.");
miner.start(1);
});
web3.eth.filter('latest', function(error, result) {
console.log(new Date() + "-- Got latest, so stopping mining");
miner.stop();
if (txpool.status.pending > 0) {