connector

This commit is contained in:
4tochka 2019-05-13 02:37:35 +04:00
parent 9eb972b0ed
commit 71e6f9d41b
2 changed files with 4 additions and 2 deletions

View File

@ -377,7 +377,7 @@ class Connector:
await self.utxo.destroy_utxo()
try: self.checkpoints.append(block["checkpoint"])
except: pass
if len(self.utxo.cached) > self.utxo.size_limit:
if len(self.utxo.cached) > self.utxo.size_limit and not self.utxo.save_process:
self.loop.create_task(self.utxo.save_utxo())

View File

@ -78,7 +78,7 @@ class UTXO():
i[1][2]))))
if block_changed:
self.cached.append({i[0]: i[1]})
self.log.critical(">" + str(len(self.cached)))
# self.log.critical(">" + str(len(self.cached)))
#
# block_height
# for key in iter(self.cached):
@ -170,12 +170,14 @@ class UTXO():
continue
break
try:
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(rows)))
for i in l:
try:
self.missed.remove(i)