Browse Source

minor

master
jahway603 3 years ago
parent
commit
a9b4331f12
  1. 9
      getstats

9
getstats

@ -11,11 +11,10 @@ use strict;
use warnings; use warnings;
use Data::Dumper; use Data::Dumper;
use JSON; use JSON;
#use Getopt::Long;
use Getopt::Long; use Getopt::Long;
my $node_client = 'hush-cli'; # hush-cli client my $node_client = 'hush-cli'; # hush-cli client
my $block_height = 699000; # start block unless changed with --block my $block_height = 699000; # start block unless changed with --block
my $version = "0.1"; my $version = "0.1";
my $print_version; my $print_version;
@ -58,7 +57,7 @@ sub read_json {
my ($raw) = @_; my ($raw) = @_;
eval { decode_json($raw) }; # eval first, bad JSON kills puppies eval { decode_json($raw) }; # eval first, bad JSON kills puppies
if (!$@) { if (!$@) {
return(decode_json($raw)); return(decode_json($raw));
@ -76,7 +75,7 @@ sub node_cli {
my $response = qx{$node_client $command 2>/dev/null}; my $response = qx{$node_client $command 2>/dev/null};
my $json = read_json($response); # bad JSON kills puppies too my $json = read_json($response);
if ($json) { if ($json) {
return($json); return($json);

Loading…
Cancel
Save