Catch errors early and exit, such as when best chain is still activating
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user