aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2022-06-19 22:02:35 +0300
committerkaotisk <kaotisk@arching-kaos.org>2022-06-19 22:02:35 +0300
commit87f2ab23e54896d648ab14c958a631ad8d2f138d (patch)
tree83b4d781f84ee3d6488bf0204fd90b230b4946a5
parent1e016904fa37c4bc3673dbafa4b9f89fd3db3d1d (diff)
downloadarching-kaos-tools-87f2ab23e54896d648ab14c958a631ad8d2f138d.tar.gz
arching-kaos-tools-87f2ab23e54896d648ab14c958a631ad8d2f138d.tar.bz2
arching-kaos-tools-87f2ab23e54896d648ab14c958a631ad8d2f138d.zip
Fixed bug that outputs invalid json when first block does not refer to GENESIS. We force an entry on the fly for it.
-rwxr-xr-xbin/enter10
1 files changed, 6 insertions, 4 deletions
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