From 0665e1ac5cf2973b44971c34fba26edc4a8ae70b Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 18 Dec 2016 00:01:14 +0900 Subject: [PATCH] Clear the touched addresses if not caught up --- server/block_processor.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/block_processor.py b/server/block_processor.py index d427dd7..b0fade0 100644 --- a/server/block_processor.py +++ b/server/block_processor.py @@ -235,11 +235,12 @@ class BlockProcessor(server.db.DB): if self.caught_up_event.is_set(): # Flush everything as queries are performed on the DB and # not in-memory. - await asyncio.sleep(0) self.flush(True) - elif time.time() > self.next_cache_check: - self.check_cache_size() - self.next_cache_check = time.time() + 60 + else: + touched.clear() + if time.time() > self.next_cache_check: + self.check_cache_size() + self.next_cache_check = time.time() + 60 if not self.first_sync: s = '' if len(blocks) == 1 else 's'