connector
This commit is contained in:
parent
6bf038020f
commit
48550e39b3
@ -412,12 +412,12 @@ class Connector:
|
|||||||
raise Exception("duplicated block")
|
raise Exception("duplicated block")
|
||||||
if "previousblockhash" not in block :
|
if "previousblockhash" not in block :
|
||||||
return
|
return
|
||||||
lb = self.block_cache.get_last()
|
lb = self.block_cache.get_last_key()
|
||||||
self.log.critical(str(lb))
|
self.log.critical(str(lb))
|
||||||
self.log.critical(str(block["previousblockhash"]))
|
self.log.critical(str(block["previousblockhash"]))
|
||||||
if lb is None and not self.last_block_height:
|
if lb is None and not self.last_block_height:
|
||||||
return
|
return
|
||||||
if self.block_cache.get_last() != block["previousblockhash"]:
|
if self.block_cache.get_last_key() != block["previousblockhash"]:
|
||||||
if self.block_cache.get(block["previousblockhash"]) is None and self.last_block_height:
|
if self.block_cache.get(block["previousblockhash"]) is None and self.last_block_height:
|
||||||
self.log.critical("Connector error! Node out of sync "
|
self.log.critical("Connector error! Node out of sync "
|
||||||
"no parent block in chain tail %s" % block["previousblockhash"])
|
"no parent block in chain tail %s" % block["previousblockhash"])
|
||||||
@ -872,11 +872,10 @@ class Cache():
|
|||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_last(self):
|
def get_last_key(self):
|
||||||
try:
|
try:
|
||||||
i = next(reversed(self._store))
|
i = next(reversed(self._store))
|
||||||
data = self._store[i]
|
return i
|
||||||
return data
|
|
||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user