mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-25 05:58:06 +00:00
Tweak invalid block check timing / settings
This commit is contained in:
parent
713521fcc2
commit
ec2f17ab04
|
@ -2,18 +2,24 @@
|
||||||
|
|
||||||
sleep 5m
|
sleep 5m
|
||||||
|
|
||||||
|
last_invalid_block=""
|
||||||
while [ 1 ]; do
|
while [ 1 ]; do
|
||||||
if [ -f /mnt/hdd/mynode/bitcoin/debug.log ]; then
|
if [ -f /mnt/hdd/mynode/bitcoin/debug.log ]; then
|
||||||
log=$(tail -n 10 /mnt/hdd/mynode/bitcoin/debug.log | grep "ERROR: AcceptBlockHeader")
|
log=$(tail -n 10 /mnt/hdd/mynode/bitcoin/debug.log | grep "ERROR: AcceptBlockHeader")
|
||||||
if [ $? == 0 ]; then
|
if [ $? == 0 ]; then
|
||||||
block=$(tail -n 10 /mnt/hdd/mynode/bitcoin/debug.log | grep "ERROR: AcceptBlockHeader" | tail -n 1 | egrep -o "block [0-9a-f]+" | awk '{print $2}')
|
block=$(tail -n 10 /mnt/hdd/mynode/bitcoin/debug.log | grep "ERROR: AcceptBlockHeader" | tail -n 1 | egrep -o "block [0-9a-f]+" | awk '{print $2}')
|
||||||
echo "INVALID BLOCK FOUND: $block"
|
if [ "$block" = "$last_invalid_block" ]; then
|
||||||
echo "Fixing..."
|
echo "ALREADY FIXED INVALID BLOCK: $block"
|
||||||
bitcoin-cli -rpccookiefile=/mnt/hdd/mynode/bitcoin/.cookie invalidateblock $block
|
else
|
||||||
bitcoin-cli -rpccookiefile=/mnt/hdd/mynode/bitcoin/.cookie reconsiderblock $block
|
echo "INVALID BLOCK FOUND: $block"
|
||||||
echo "Done fixing block $block"
|
echo "Fixing..."
|
||||||
sleep 30m
|
bitcoin-cli -rpccookiefile=/mnt/hdd/mynode/bitcoin/.cookie invalidateblock $block
|
||||||
|
bitcoin-cli -rpccookiefile=/mnt/hdd/mynode/bitcoin/.cookie reconsiderblock $block
|
||||||
|
last_invalid_block=$block
|
||||||
|
echo "Done fixing block $block"
|
||||||
|
sleep 5m
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
sleep 5m
|
sleep 3m
|
||||||
done
|
done
|
Loading…
Reference in New Issue
Block a user