diff --git a/bin/localstate.pl b/bin/localstate.pl index fc90f4eba9322e1a4753f157ff3d78eb476adeca..e6064f61847478ef08a82d3b13ce6bc4a3bed15d 100755 --- a/bin/localstate.pl +++ b/bin/localstate.pl @@ -262,11 +262,15 @@ if ( $result ) foreach my $account ( sort @$result ) { my $maymine = ''; - $maymine = ' sealer' + $maymine = 'sealer' if exists $signers{$account}; printf "Locally available account%s:\n", scalar @$result == 1 ? '' : 's' if $i++ == 0; - printf "Account %d: %s%s\n", $i, $account, $maymine; + my $txn = rpc( $libbfa, 'eth_getTransactionCount', qq("$account"), '"latest"' ); + $txn =~ s/^0x([a-fA-F\d]+)$/hex($1)/e; + my $gold = rpc( $libbfa, 'eth_getBalance', qq("$account"), '"latest"' ); + $gold =~ s/^0x([a-fA-F\d]+)$/hex($1)/e; + printf "Account %d: %s %-6s %3d transaction%s, %d satoshi.\n", $i, $account, $maymine, $txn, ($txn==1?' ':'s'), $gold; } } else