From a4fe027fb3dfff0e9d1bcf01188c556c8565491d Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 24 May 2015 09:04:44 -0400 Subject: [PATCH] mine when a transaction comes in --- js/mine.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 js/mine.js diff --git a/js/mine.js b/js/mine.js new file mode 100644 index 00000000..59f40afc --- /dev/null +++ b/js/mine.js @@ -0,0 +1,10 @@ + +setInterval(function() { + if(web3.eth.pendingTransactions().length > 0 && !web3.eth.mining) { + admin.miner.start(); + } + else { + admin.miner.stop(); + } +}, 1000) +