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.
This commit is contained in:
linagee 2015-07-01 11:56:09 -06:00 committed by Iuri Matias
parent e01a339756
commit 961dac4645
1 changed files with 5 additions and 2 deletions

View File

@ -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())) {