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