From 71bff27245865f7b39be2a8ffd9bf43e994577a6 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 28 Jan 2018 21:45:43 -0600 Subject: [PATCH] do not add block in addblock function if it already is added --- onionr/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onionr/core.py b/onionr/core.py index d0a9bf0e..6617f1e8 100644 --- a/onionr/core.py +++ b/onionr/core.py @@ -134,6 +134,8 @@ class Core: '''add a hash value to the block db (should be in hex format)''' if not os.path.exists(self.blockDB): raise Exception('Block db does not exist') + if self._utils.hasBlock(newHash): + return conn = sqlite3.connect(self.blockDB) c = conn.cursor() currentTime = math.floor(time.time())