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 zmq.asyncio
import asyncio import asyncio
import time import time
from _pickle import loads, dumps from _pickle import loads
from collections import OrderedDict, deque
class Connector: class Connector:
def __init__(self, node_rpc_url, node_zerromq_url, logger, def __init__(self, node_rpc_url, node_zerromq_url, logger,

View File

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