From d7392213cb0fd8b71b8299cc92c448e34a7445a3 Mon Sep 17 00:00:00 2001 From: Arinerron Date: Mon, 24 Sep 2018 21:16:51 -0700 Subject: [PATCH] Slight changes, I forgot --- Makefile | 1 + onionr/onionrblockapi.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 13d9c0f9..1550e078 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ soft-reset: reset: @echo "Hard-resetting Onionr..." rm -rf onionr/data/ | true > /dev/null 2>&1 + cd onionr/static-data/www/ui/; rm -rf ./dist; python compile.py #@./RUN-LINUX.sh version | grep -v "Failed" --color=always plugins-reset: diff --git a/onionr/onionrblockapi.py b/onionr/onionrblockapi.py index 825e61e5..87ca2984 100644 --- a/onionr/onionrblockapi.py +++ b/onionr/onionrblockapi.py @@ -188,7 +188,11 @@ class Block: return True except Exception as e: - logger.error('Failed to update block data.', error = e, timestamp = False) + logger.error('Failed to parse block %s.' % self.getHash(), error = e, timestamp = False) + + # if block can't be parsed, it's a waste of precious space. Throw it away. + if not self.delete(): + logger.error('Failed to delete invalid block %s.' % self.getHash(), error = e) self.valid = False return False