1
0

simplification: do not request checkpoint, check headers against all known blockchains

This commit is contained in:
ThomasV
2017-07-17 19:32:10 +02:00
parent 3d4c64f9e0
commit 702abf6581
2 changed files with 57 additions and 62 deletions

View File

@@ -72,7 +72,7 @@ def read_blockchains(config):
blockchains[b.checkpoint] = b
return blockchains
def get_blockchain(header):
def check_header(header):
if type(header) is not dict:
return False
for b in blockchains.values():
@@ -80,6 +80,11 @@ def get_blockchain(header):
return b
return False
def can_connect(header):
for b in blockchains.values():
if b.can_connect(header):
return b
return False
class Blockchain(util.PrintError):