mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
network dialog: show only populated chains
This commit is contained in:
parent
125247df81
commit
05a9718b7c
1 changed files with 9 additions and 8 deletions
|
@ -98,19 +98,20 @@ class NodesListWidget(QTreeWidget):
|
|||
n_chains = len(network.blockchains)
|
||||
if n_chains > 1:
|
||||
for b in network.blockchains.values():
|
||||
name = network.get_blockchain_name(b)
|
||||
x = QTreeWidgetItem([name + '@%d'%checkpoint, '%d'%b.height()])
|
||||
x.setData(0, Qt.UserRole, 1)
|
||||
x.setData(1, Qt.UserRole, b.checkpoint)
|
||||
for i in network.interfaces.values():
|
||||
if i.blockchain == b:
|
||||
items = filter(lambda i: i.blockchain==b, network.interfaces.values())
|
||||
if items:
|
||||
name = network.get_blockchain_name(b)
|
||||
x = QTreeWidgetItem([name + '@%d'%checkpoint, '%d'%b.height()])
|
||||
x.setData(0, Qt.UserRole, 1)
|
||||
x.setData(1, Qt.UserRole, b.checkpoint)
|
||||
for i in items:
|
||||
star = ' *' if i == network.interface else ''
|
||||
item = QTreeWidgetItem([i.host + star, '%d'%i.tip])
|
||||
item.setData(0, Qt.UserRole, 0)
|
||||
item.setData(1, Qt.UserRole, i.server)
|
||||
x.addChild(item)
|
||||
self.addTopLevelItem(x)
|
||||
x.setExpanded(True)
|
||||
self.addTopLevelItem(x)
|
||||
x.setExpanded(True)
|
||||
else:
|
||||
for i in network.interfaces.values():
|
||||
star = ' *' if i == network.interface else ''
|
||||
|
|
Loading…
Add table
Reference in a new issue