Browse Source

Basic CLI help and error checking for a valid stride

pull/208/head
Duke Leto 2 years ago
parent
commit
0fb9db169c
  1. 10
      util/checkpoints.pl

10
util/checkpoints.pl

@ -10,6 +10,16 @@ my $perday = 1152;
my $hush = "./src/hush-cli";
my $gethash = "$hush getblockhash";
my $stride = shift || 1000;
if ($stride =~ m/help/) {
print "To generate checkpoint data every 1000 blocks: $0 &> checkpoints.txt\n";
print "To generate checkpoint data every X blocks: $0 X &> checkpoints.txt\n";
exit 0;
}
unless ($stride == int($stride) and $stride >= 0) {
print "Invalid stride! Must be an integer > 0\n";
exit 1;
}
my $count = 0;
my $blocks = qx{$hush getblockcount};
if($?) {

Loading…
Cancel
Save