From 2ddf539185ab9ffe1a5714ead8574e2f30c932f4 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Thu, 15 Sep 2022 19:41:28 -0400 Subject: [PATCH] Check if hush-cli binary exists before using it --- contrib/block_time.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/block_time.pl b/contrib/block_time.pl index e91f22d19..0366aa8f9 100755 --- a/contrib/block_time.pl +++ b/contrib/block_time.pl @@ -8,6 +8,9 @@ use strict; # Given a block time, estimate when it will happen my $block = shift || die "Usage: $0 123"; my $hush = "./src/hush-cli"; +unless (-e $hush) { + die "$hush does not exist, aborting"; +} my $blockcount = qx{$hush getblockcount}; unless ($blockcount = int($blockcount)) {