connector

This commit is contained in:
4tochka 2019-05-09 23:54:27 +04:00
parent a9b22a4e6d
commit 91feaee73f
3 changed files with 5 additions and 5 deletions

View File

@ -380,9 +380,9 @@ class Connector:
self.last_block_height = block["height"]
if self.utxo_data:
if not self.deep_synchronization:
self.utxo.destroy_utxo(block["height"])
self.utxo.destroy_utxo()
elif block["height"] % 500 == 0:
self.utxo.destroy_utxo(block["height"])
self.utxo.destroy_utxo()
self.blocks_processed_count += 1

View File

@ -371,7 +371,7 @@ class Connector:
self.block_headers_cache.set(block["hash"], block["height"])
self.last_block_height = block["height"]
if self.utxo_data:
self.utxo.destroy_utxo(block["height"])
self.utxo.destroy_utxo()
self.blocks_processed_count += 1

View File

@ -34,7 +34,7 @@ class UTXO():
self.outs_total = 0
def set(self, outpoint, pointer, amount, address):
self.cached[outpoint] = (pointer, amount, address)
self.cached[outpoint] = [pointer, amount, address]
self.outs_total += 1
if pointer:
self.last_cached_block = pointer >> 42
@ -42,7 +42,7 @@ class UTXO():
def remove(self, outpoint):
del self.cached[outpoint]
def destroy_utxo(self, block_height):
def destroy_utxo(self):
while self.destroyed:
outpoint = self.destroyed.pop()
try: