Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- web3.eth.getBlock("pending",(function(e,r){
- var b = r.transactions.length;
- console.log(b);
- console.log(web3.eth.mining);
- if (!e){
- if (b > 0) {
- if (web3.eth.mining) return;
- console.log("== Pending transactions! Mining...");
- web3.miner.start(1);
- } else {
- web3.miner.stop(0); // This param means nothing
- console.log("== No transactions! Mining stopped.");
- }
- }}))
Add Comment
Please, Sign In to add comment