From 1cc5ce981321b82eda34780e2968a1ba4d56a529 Mon Sep 17 00:00:00 2001 From: 4tochka Date: Mon, 13 May 2019 17:52:21 +0400 Subject: [PATCH] connector --- pybtc/connector/utxo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pybtc/connector/utxo.py b/pybtc/connector/utxo.py index 6131142..0c2591c 100644 --- a/pybtc/connector/utxo.py +++ b/pybtc/connector/utxo.py @@ -65,10 +65,11 @@ class UTXO(): checkpoint = self.checkpoints.popleft() else: checkpoint_found = True - elif checkpoint < lb - 1 and self.checkpoints: + while self.checkpoints and checkpoint < lb - 1: checkpoint = self.checkpoints.popleft() + if len(self.cached) <= self.size_limit: if block_changed and checkpoint_found: break @@ -186,14 +187,14 @@ class UTXO(): continue break try: - + self.log.critical("load utxo " + str(self.missed)) self.load_utxo_future = asyncio.Future() l = set(self.missed) async with self._db_pool.acquire() as conn: rows = await conn.fetch("SELECT outpoint, connector_utxo.data " "FROM connector_utxo " "WHERE outpoint = ANY($1);", l) - self.log.critical("-"+str(len(self.missed))) + self.log.critical("loaded "+str(len(self.missed))) for i in l: try: self.missed.remove(i)