1
0

show only active chains

This commit is contained in:
ThomasV
2017-07-18 21:37:04 +02:00
parent a39e270bd3
commit 814792eee1
2 changed files with 27 additions and 22 deletions

View File

@@ -1001,9 +1001,16 @@ class Network(util.DaemonThread):
if self.interface and self.interface.blockchain is not None:
self.blockchain_index = self.interface.blockchain.checkpoint
self.config.set_key('blockchain_index', self.blockchain_index)
return self.blockchains[self.blockchain_index]
def get_blockchains(self):
out = {}
for k, b in self.blockchains.items():
r = filter(lambda i: i.blockchain==b, self.interfaces.values())
if r:
out[k] = r
return out
def get_blockchain_name(self, blockchain):
checkpoint = self.get_checkpoint()
_hash = blockchain.get_hash(checkpoint)