mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 12:23:11 +02:00
change blockchain size calculation
This commit is contained in:
@@ -114,9 +114,20 @@ waitUntilChainNetworkIsReady()
|
|||||||
rm error.tmp
|
rm error.tmp
|
||||||
|
|
||||||
# check for missing blockchain data
|
# check for missing blockchain data
|
||||||
|
if [ "${network}" = "bitcoin" ]; then
|
||||||
|
if [ "${chain}" = "main" ]; then
|
||||||
minSize=210000000000
|
minSize=210000000000
|
||||||
if [ "${network}" = "litecoin" ]; then
|
else
|
||||||
|
minSize=27000000000
|
||||||
|
fi
|
||||||
|
elif [ "${network}" = "litecoin" ]; then
|
||||||
|
if [ "${chain}" = "main" ]; then
|
||||||
minSize=20000000000
|
minSize=20000000000
|
||||||
|
else
|
||||||
|
minSize=27000000000
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
minSize=210000000000000
|
||||||
fi
|
fi
|
||||||
isSyncing=$(sudo ls -la /mnt/hdd/${network}/blocks/.selfsync 2>/dev/null | grep -c '.selfsync')
|
isSyncing=$(sudo ls -la /mnt/hdd/${network}/blocks/.selfsync 2>/dev/null | grep -c '.selfsync')
|
||||||
blockchainsize=$(sudo du -shbc /mnt/hdd/${network}/ 2>/dev/null | head -n1 | awk '{print $1;}')
|
blockchainsize=$(sudo du -shbc /mnt/hdd/${network}/ 2>/dev/null | head -n1 | awk '{print $1;}')
|
||||||
|
@@ -125,22 +125,22 @@ sudo unlink /home/bitcoin/.bitcoin
|
|||||||
# make quick check if data is there
|
# make quick check if data is there
|
||||||
anyDataAtAll=0
|
anyDataAtAll=0
|
||||||
quickCheckOK=1
|
quickCheckOK=1
|
||||||
count=$(sudo ls /mnt/hdd/bitcoin/blocks 2>/dev/null | grep -c '.dat')
|
count=$(sudo find /mnt/hdd/bitcoin/ -iname *.dat -type f | wc -l)
|
||||||
if [ ${count} -gt 0 ]; then
|
if [ ${count} -gt 0 ]; then
|
||||||
echo "Found data in /mnt/hdd/bitcoin/blocks"
|
echo "Found data in /mnt/hdd/bitcoin/blocks"
|
||||||
anyDataAtAll=1
|
anyDataAtAll=1
|
||||||
fi
|
fi
|
||||||
if [ ${count} -lt 3000 ]; then
|
if [ ${count} -lt 300 ]; then
|
||||||
echo "FAIL: transfere seems invalid - less then 3000 .dat files (${count})"
|
echo "FAIL: transfere seems invalid - less then 300 .dat files (${count})"
|
||||||
quickCheckOK=0
|
quickCheckOK=0
|
||||||
fi
|
fi
|
||||||
count=$(sudo ls /mnt/hdd/bitcoin/chainstate 2>/dev/null | grep -c '.ldb')
|
count=$(sudo find /mnt/hdd/bitcoin/ -iname *.ldb -type f | wc -l)
|
||||||
if [ ${count} -gt 0 ]; then
|
if [ ${count} -gt 0 ]; then
|
||||||
echo "Found data in /mnt/hdd/bitcoin/chainstate"
|
echo "Found data in /mnt/hdd/bitcoin/chainstate"
|
||||||
anyDataAtAll=1
|
anyDataAtAll=1
|
||||||
fi
|
fi
|
||||||
if [ ${count} -lt 1400 ]; then
|
if [ ${count} -lt 700 ]; then
|
||||||
echo "FAIL: transfere seems invalid - less then 1400 .ldb files (${count})"
|
echo "FAIL: transfere seems invalid - less then 700 .ldb files (${count})"
|
||||||
quickCheckOK=0
|
quickCheckOK=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -88,22 +88,22 @@ read key
|
|||||||
# make quick check if data is there
|
# make quick check if data is there
|
||||||
anyDataAtAll=0
|
anyDataAtAll=0
|
||||||
quickCheckOK=1
|
quickCheckOK=1
|
||||||
count=$(sudo ls /mnt/hdd/bitcoin/blocks 2>/dev/null | grep -c '.dat')
|
count=$(sudo find /mnt/hdd/bitcoin/ -iname *.dat -type f | wc -l)
|
||||||
if [ ${count} -gt 0 ]; then
|
if [ ${count} -gt 0 ]; then
|
||||||
echo "Found data in /mnt/hdd/bitcoin/blocks"
|
echo "Found data in /mnt/hdd/bitcoin/blocks"
|
||||||
anyDataAtAll=1
|
anyDataAtAll=1
|
||||||
fi
|
fi
|
||||||
if [ ${count} -lt 3000 ]; then
|
if [ ${count} -lt 300 ]; then
|
||||||
echo "FAIL: transfere seems invalid - less then 3000 .dat files (${count})"
|
echo "FAIL: transfere seems invalid - less then 300 .dat files (${count})"
|
||||||
quickCheckOK=0
|
quickCheckOK=0
|
||||||
fi
|
fi
|
||||||
count=$(sudo ls /mnt/hdd/bitcoin/chainstate 2>/dev/null | grep -c '.ldb')
|
count=$(sudo find /mnt/hdd/bitcoin/ -iname *.ldb -type f | wc -l)
|
||||||
if [ ${count} -gt 0 ]; then
|
if [ ${count} -gt 0 ]; then
|
||||||
echo "Found data in /mnt/hdd/bitcoin/chainstate"
|
echo "Found data in /mnt/hdd/bitcoin/chainstate"
|
||||||
anyDataAtAll=1
|
anyDataAtAll=1
|
||||||
fi
|
fi
|
||||||
if [ ${count} -lt 1400 ]; then
|
if [ ${count} -lt 700 ]; then
|
||||||
echo "FAIL: transfere seems invalid - less then 1400 .ldb files (${count})"
|
echo "FAIL: transfere seems invalid - less then 700 .ldb files (${count})"
|
||||||
quickCheckOK=0
|
quickCheckOK=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user