Catch errors early and exit, such as when best chain is still activating

This commit is contained in:
Duke Leto
2020-07-17 01:24:50 -04:00
parent acead3ea3e
commit 3110898426

View File

@@ -1,5 +1,5 @@
#!/usr/bin/perl
# Copyright 2019 The Hush developers
# Copyright 2019-2020 The Hush developers
# Released under the GPLv3
use warnings;
use strict;
@@ -12,6 +12,10 @@ my $gethash = "$hush getblockhash";
my $stride = shift || 1000;
my $count = 0;
my $blocks = qx{$hush getblockcount};
if($?) {
print "ERROR, exiting...\n";
exit 1;
}
my $prev = $blocks - $perday;
my $last = 0;
my $now = time();