mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-20 10:12:06 +01:00
change blockchain size calculation
This commit is contained in:
parent
da84ee0ad9
commit
77074b7b05
@ -114,9 +114,20 @@ waitUntilChainNetworkIsReady()
|
||||
rm error.tmp
|
||||
|
||||
# check for missing blockchain data
|
||||
minSize=210000000000
|
||||
if [ "${network}" = "litecoin" ]; then
|
||||
minSize=20000000000
|
||||
if [ "${network}" = "bitcoin" ]; then
|
||||
if [ "${chain}" = "main" ]; then
|
||||
minSize=210000000000
|
||||
else
|
||||
minSize=27000000000
|
||||
fi
|
||||
elif [ "${network}" = "litecoin" ]; then
|
||||
if [ "${chain}" = "main" ]; then
|
||||
minSize=20000000000
|
||||
else
|
||||
minSize=27000000000
|
||||
fi
|
||||
else
|
||||
minSize=210000000000000
|
||||
fi
|
||||
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;}')
|
||||
|
@ -125,22 +125,22 @@ sudo unlink /home/bitcoin/.bitcoin
|
||||
# make quick check if data is there
|
||||
anyDataAtAll=0
|
||||
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
|
||||
echo "Found data in /mnt/hdd/bitcoin/blocks"
|
||||
anyDataAtAll=1
|
||||
fi
|
||||
if [ ${count} -lt 3000 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 3000 .dat files (${count})"
|
||||
if [ ${count} -lt 300 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 300 .dat files (${count})"
|
||||
quickCheckOK=0
|
||||
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
|
||||
echo "Found data in /mnt/hdd/bitcoin/chainstate"
|
||||
anyDataAtAll=1
|
||||
fi
|
||||
if [ ${count} -lt 1400 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 1400 .ldb files (${count})"
|
||||
if [ ${count} -lt 700 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 700 .ldb files (${count})"
|
||||
quickCheckOK=0
|
||||
fi
|
||||
|
||||
@ -178,4 +178,4 @@ fi
|
||||
if [ ${setupStep} -lt 100 ]; then
|
||||
# setup script will decide the next logical step
|
||||
/home/admin/10setupBlitz.sh
|
||||
fi
|
||||
fi
|
||||
|
@ -88,22 +88,22 @@ read key
|
||||
# make quick check if data is there
|
||||
anyDataAtAll=0
|
||||
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
|
||||
echo "Found data in /mnt/hdd/bitcoin/blocks"
|
||||
anyDataAtAll=1
|
||||
fi
|
||||
if [ ${count} -lt 3000 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 3000 .dat files (${count})"
|
||||
if [ ${count} -lt 300 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 300 .dat files (${count})"
|
||||
quickCheckOK=0
|
||||
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
|
||||
echo "Found data in /mnt/hdd/bitcoin/chainstate"
|
||||
anyDataAtAll=1
|
||||
fi
|
||||
if [ ${count} -lt 1400 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 1400 .ldb files (${count})"
|
||||
if [ ${count} -lt 700 ]; then
|
||||
echo "FAIL: transfere seems invalid - less then 700 .ldb files (${count})"
|
||||
quickCheckOK=0
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user