From 961dac4645bad12f91de28edf48243944faf7382 Mon Sep 17 00:00:00 2001 From: linagee Date: Wed, 1 Jul 2015 11:56:09 -0600 Subject: [PATCH] web3.eth.pendingTransactions is not a function See https://github.com/iurimatias/embark-framework/issues/15 Also, minimalAmount was set too low for demo contract to launch. --- js/mine.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/mine.js b/js/mine.js index 7c61b11b..383dc152 100644 --- a/js/mine.js +++ b/js/mine.js @@ -9,14 +9,17 @@ setInterval(function() { miner_var = admin.miner; } - var minimalAmount = (web3.eth.getBalance(web3.eth.coinbase) >= 1500000000000000000); + var minimalAmount = (web3.eth.getBalance(web3.eth.coinbase) >= 15000000000000000000); var pendingTransactions = function() { if (web3.eth.pendingTransactions === undefined) { return txpool.status.pending || txpool.status.queued; } - else { + else if (typeof web3.eth.pendingTransactions === "function") { return web3.eth.pendingTransactions().length > 0; } + else { + return web3.eth.getBlock('pending').transactions.length > 0; + } } if(!web3.eth.mining && (!minimalAmount || pendingTransactions())) {