update mining script to take to work with 0.9.35

This commit is contained in:
Iuri Matias 2015-07-02 07:39:24 -04:00
parent 961dac4645
commit f4ba7dc817

View File

@ -11,14 +11,14 @@ setInterval(function() {
var minimalAmount = (web3.eth.getBalance(web3.eth.coinbase) >= 15000000000000000000);
var pendingTransactions = function() {
if (web3.eth.pendingTransactions === undefined) {
if (web3.eth.pendingTransactions === undefined || web3.eth.pendingTransactions === null) {
return txpool.status.pending || txpool.status.queued;
}
else if (typeof web3.eth.pendingTransactions === "function") {
return web3.eth.pendingTransactions().length > 0;
}
else {
return web3.eth.getBlock('pending').transactions.length > 0;
return web3.eth.pendingTransactions.length > 0 || web3.eth.getBlock('pending').transactions.length > 0;
}
}