From 8749a63dd8cac99bff0857761c691c4a5a2c85af Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 24 May 2015 09:36:19 -0400 Subject: [PATCH] mine a minimal amount --- js/mine.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/mine.js b/js/mine.js index 59f40afc..053e0968 100644 --- a/js/mine.js +++ b/js/mine.js @@ -1,6 +1,8 @@ setInterval(function() { - if(web3.eth.pendingTransactions().length > 0 && !web3.eth.mining) { + + var minimalAmount = (web3.eth.getBalance(web3.eth.coinbase) >= 1500000000000000000); + if(!web3.eth.mining && (!minimalAmount || web3.eth.pendingTransactions().length > 0)) { admin.miner.start(); } else {