Skip to content
Snippets Groups Projects
Commit a7eee69f authored by Vincent Texier's avatar Vincent Texier
Browse files

Fix bug in wot certified-by display

parent 4e52cc6e
No related branches found
No related tags found
No related merge requests found
...@@ -131,18 +131,23 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): ...@@ -131,18 +131,23 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
).strftime("%Y/%m/%d"), ).strftime("%Y/%m/%d"),
'cert_time': certified['cert_time']['medianTime'] 'cert_time': certified['cert_time']['medianTime']
} }
graph[public_key]['arcs'].append(arc)
# removed old duplicated arcs # replace old arc if this one is more recent
arcs = list() new_arc = True
index = 0
for a in graph[public_key]['arcs']: for a in graph[public_key]['arcs']:
# if same arc already exists... # if same arc already exists...
if a['id'] == arc['id']: if a['id'] == arc['id']:
# if arc more recent, dont keep old one... # if arc more recent, dont keep old one...
if arc['cert_time'] > a['cert_time']: if arc['cert_time'] >= a['cert_time']:
continue graph[public_key]['arcs'][index] = arc
arcs.append(a) new_arc = False
# replace arcs with updated list index += 1
graph[public_key]['arcs'] = arcs
# if arc not in graph...
if new_arc:
# add arc in graph
graph[public_key]['arcs'].append(arc)
# draw graph in qt scene # draw graph in qt scene
self.graphicsView.scene().update_wot(graph) self.graphicsView.scene().update_wot(graph)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment