From 98a17b74233e39b038f1a97cb87eb2c3f8bf288e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 Aug 2018 03:29:53 +0200 Subject: [PATCH] faster chain check --- home.admin/70initLND.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index 426c33f..8bcd166 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -5,7 +5,11 @@ echo "" network=`cat .network` # get chain -chain=$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain') +chain="test" +isMainChain=$(sudo cat /mnt/hdd/${network}/${network}.conf 2>/dev/null | grep "#testnet=1" -c) +if [ ${isMainChain} -gt 0 ];then + chain="main" +fi # verify that bitcoin is running echo "*** Checking ${network} ***"