detec txindex finished

This commit is contained in:
rootzoll
2019-12-18 23:56:55 +01:00
parent fb5f1e2967
commit bdf0c62427

View File

@@ -28,9 +28,11 @@ if [ "$1" = "status" ]; then
# try to gather if still indexing # try to gather if still indexing
indexedToBlock=$(sudo tail -n 100 /mnt/hdd/${network}/debug.log | grep "Syncing txindex with block chain from height" | tail -n 1 | cut -d " " -f 9 | sed 's/[^0-9]*//g') indexedToBlock=$(sudo tail -n 100 /mnt/hdd/${network}/debug.log | grep "Syncing txindex with block chain from height" | tail -n 1 | cut -d " " -f 9 | sed 's/[^0-9]*//g')
blockchainHeight=$(sudo -u bitcoin ${network}-cli getblockchaininfo 2>/dev/null | jq -r '.blocks' | sed 's/[^0-9]*//g') blockchainHeight=$(sudo -u bitcoin ${network}-cli getblockchaininfo 2>/dev/null | jq -r '.blocks' | sed 's/[^0-9]*//g')
indexFinished=$(sudo tail -n 100 /mnt/hdd/${network}/debug.log | grep -c "txindex is enabled at height")
echo "indexedToBlock=${indexedToBlock}" echo "indexedToBlock=${indexedToBlock}"
echo "blockchainHeight=${blockchainHeight}" echo "blockchainHeight=${blockchainHeight}"
if [ ${#indexedToBlock} -eq 0 ] || [ "${indexedToBlock}" = "${blockchainHeight}" ]; then echo "indexFinished=${indexFinished}"
if [ ${#indexedToBlock} -eq 0 ] || [ ${indexFinished} -gt 0 ] || [ "${indexedToBlock}" = "${blockchainHeight}" ]; then
echo "isIndexed=1" echo "isIndexed=1"
indexInfo="OK" indexInfo="OK"
else else