From 31108984264949e1039ffcace5984238bb837d89 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Fri, 17 Jul 2020 01:24:50 -0400 Subject: [PATCH] Catch errors early and exit, such as when best chain is still activating --- contrib/checkpoints.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/checkpoints.pl b/contrib/checkpoints.pl index 99a84f2c2..93ea1041c 100755 --- a/contrib/checkpoints.pl +++ b/contrib/checkpoints.pl @@ -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();