connector

This commit is contained in:
4tochka 2019-05-08 12:04:23 +04:00
parent 13aa3e2a52
commit 60b114fbcf
2 changed files with 10 additions and 9 deletions

View File

@ -377,11 +377,11 @@ class Connector:
self.block_headers_cache.set(block["hash"], block["height"]) self.block_headers_cache.set(block["hash"], block["height"])
self.last_block_height = block["height"] self.last_block_height = block["height"]
if self.utxo_data: # if self.utxo_data:
if not self.deep_synchronization: # if not self.deep_synchronization:
self.utxo.destroy_utxo(block["height"]) # self.utxo.destroy_utxo(block["height"])
elif block["height"] % 500 == 0: # elif block["height"] % 500 == 0:
self.utxo.destroy_utxo(block["height"]) # self.utxo.destroy_utxo(block["height"])
self.blocks_processed_count += 1 self.blocks_processed_count += 1

View File

@ -133,10 +133,11 @@ class UTXO():
self._requests += 1 self._requests += 1
try: try:
i = self.cached[key] i = self.cached[key]
try: self.destroyed[key] = block_height
self.destroyed[block_height].add(key) # try:
except: # self.destroyed[block_height].add(key)
self.destroyed[block_height] = {key} # except:
# self.destroyed[block_height] = {key}
self._hit += 1 self._hit += 1
return i return i
except: except: