Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkAllBalances() {
- var totalBal = 0;
- for (var acctNum in eth.accounts) {
- var acct = eth.accounts[acctNum];
- var acctBal = web3.fromWei(eth.getBalance(acct), "ether");
- totalBal += parseFloat(acctBal);
- console.log(" eth.accounts[" + acctNum + "]: \t" + acct + " \tbalance: " + acctBal + " ether");
- }
- console.log(" Total balance: " + totalBal + " ether");
- };
- checkAllBalances();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement