mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-26 19:47:05 +02:00
detec txindex finished
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user