From 80e065568bbedce79b75ac9d20f72c64a3f1c8a1 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sun, 8 Dec 2019 12:49:52 -0500 Subject: [PATCH] Add script to generate checkpoint data --- contrib/checkpoints.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 contrib/checkpoints.pl diff --git a/contrib/checkpoints.pl b/contrib/checkpoints.pl new file mode 100755 index 000000000..ea81da1df --- /dev/null +++ b/contrib/checkpoints.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl +use warnings; +use strict; +# Generate checkpoint data for use in src/main.cpp + +my $hush = "./src/hush-cli"; +my $gethash = "$hush getblockhash"; +my $stride = shift || 1000; +my $count = 0; +my $blocks = qx{$hush getblockcount}; + +while (1) { + $count++; + my $block = $stride*$count; + last if ($block > $blocks); + my $blockhash = qx{$gethash $block}; + chomp $blockhash; + print qq{($block, uint256S("0x$blockhash"))\n}; +}