connector

This commit is contained in:
4tochka 2019-05-09 23:29:10 +04:00
parent 5b3bc9e5f5
commit a9b22a4e6d

View File

@ -43,23 +43,18 @@ class UTXO():
del self.cached[outpoint] del self.cached[outpoint]
def destroy_utxo(self, block_height): def destroy_utxo(self, block_height):
block_height -= self.maturity
while self.destroyed: while self.destroyed:
r = self.destroyed.pop() outpoint = self.destroyed.pop()
if r[1] > block_height: try:
self.destroyed.appendleft(r) del self.cached[outpoint]
break self.destroyed_utxo += 1
else: except:
try: try:
del self.cached[r[0]] del self.loaded[outpoint]
self.destroyed_utxo += 1 self.destroyed_utxo += 1
except: except:
try: self.destroyed_utxo += 1
del self.loaded[r[0]] pass
self.destroyed_utxo += 1
except:
self.destroyed_utxo += 1
pass
return return
@ -153,7 +148,7 @@ class UTXO():
self._requests += 1 self._requests += 1
try: try:
i = self.cached[key] i = self.cached[key]
self.destroyed.append((key, block_height)) self.destroyed.append(key)
# try: # try:
# self.destroyed[block_height].add(key) # self.destroyed[block_height].add(key)
# except: # except: