mine when a transaction comes in

This commit is contained in:
Iuri Matias 2015-05-24 09:04:44 -04:00
parent fa17f72df1
commit a4fe027fb3
1 changed files with 10 additions and 0 deletions

10
js/mine.js Normal file
View File

@ -0,0 +1,10 @@
setInterval(function() {
if(web3.eth.pendingTransactions().length > 0 && !web3.eth.mining) {
admin.miner.start();
}
else {
admin.miner.stop();
}
}, 1000)