From 64d891d0b23a632b6a39f82083f56c4bbdc76b92 Mon Sep 17 00:00:00 2001
From: Christian Rotzoll <christian@geektank.de>
Date: Tue, 30 Jul 2019 04:59:57 +0200
Subject: [PATCH] remove debug output

---
 home.admin/config.scripts/blitz.statusscan.sh | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/home.admin/config.scripts/blitz.statusscan.sh b/home.admin/config.scripts/blitz.statusscan.sh
index a2dbed1..60f3a96 100644
--- a/home.admin/config.scripts/blitz.statusscan.sh
+++ b/home.admin/config.scripts/blitz.statusscan.sh
@@ -217,17 +217,18 @@ if [ ${lndRunning} -eq 1 ]; then
 
     # lnd scan progress
     scanTimestamp=$(echo ${lndinfo} | jq -r '.best_header_timestamp')
+    nowTimestamp=$(date +%s)
+    if [ ${scanTimestamp} -gt ${nowTimestamp} ]; then
+      scanTimestamp=${nowTimestamp}
+    fi
     if [ ${#scanTimestamp} -gt 0 ]; then
       echo "scanTimestamp=${scanTimestamp}"
-      scanDate=$(date -d @${scanTimestamp})
+      scanDate=$(date -d @${scanTimestamp} 2>/dev/null)
       echo "scanDate='${scanDate}'"
-
+      
       # calculate LND scan progress by seconds since Genesisblock
       genesisTimestamp=1230940800
-      nowTimestamp=$(date +%s)
-      if [ ${scanTimestamp} -gt ${nowTimestamp} ]; then
-        scanTimestamp=${nowTimestamp}
-      fi
+
       totalSeconds=$(echo "${nowTimestamp}-${genesisTimestamp}" | bc)
       scannedSeconds=$(echo "${scanTimestamp}-${genesisTimestamp}" | bc)
       scanProgress=$(echo "scale=2; $scannedSeconds*100/$totalSeconds" | bc)