From 87f2ab23e54896d648ab14c958a631ad8d2f138d Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 19 Jun 2022 22:02:35 +0300 Subject: Fixed bug that outputs invalid json when first block does not refer to GENESIS. We force an entry on the fly for it. --- bin/enter | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bin/enter') diff --git a/bin/enter b/bin/enter index 3d1897c..d2e2bb9 100755 --- a/bin/enter +++ b/bin/enter @@ -60,8 +60,9 @@ then if [ -v $previous ] then - echo "Block $block has no previous zblock" - exit 3 + logthis "Block $block has no previous zblock $previous" + echo '"previous":"genesis"},{"genesis":"genesis"}]' + exit 0 else echo '"previous":"'$previous'"},' zblock=$previous @@ -170,8 +171,9 @@ do # code 3 if [ -v $previous ] then - echo "Block $block has no previous zblock" - exit 3 + logthis "Block $block has no previous zblock" + echo '"previous":"genesis"},{"genesis":"genesis"}]' + exit 0 # Otherwise, we inform of the sequence else -- cgit v1.2.3