connector

This commit is contained in:
4tochka 2019-05-13 17:12:53 +04:00
parent ba7c5db53f
commit be807082e7
2 changed files with 3 additions and 4 deletions

View File

@ -12,8 +12,7 @@ import zmq
import zmq.asyncio
import asyncio
import time
from _pickle import loads, dumps
from collections import OrderedDict, deque
from _pickle import loads
class Connector:
def __init__(self, node_rpc_url, node_zerromq_url, logger,

View File

@ -55,14 +55,14 @@ class UTXO():
checkpoint_found = False
utxo = set()
while self.cached:
i = self.cached.popleft()
i = self.cached.pop()
if lb != i[1][0] >> 42:
block_changed = True
lb = i[1][0] >> 42
if lb - 1 == checkpoint:
if len(self.cached) > self.size_limit:
if self.checkpoints:
checkpoint = self.checkpoints.pop()
checkpoint = self.checkpoints.popleft()
else:
checkpoint_found = True