Skip to content

Commit

Permalink
dnet: add additional check to prevent logic error
Browse files Browse the repository at this point in the history
also remove unnecessary nesting
  • Loading branch information
lunar-mining committed Nov 12, 2023
1 parent b94b6fb commit 6bf00e5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions bin/dnet/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,23 @@ def events(self, nodes):
self.fill_right_box()

if 'inbound' in info:
# New inbound online.
for key in info['inbound'].keys():
# New inbound online.
if key not in self.known_inbound:
addr = info['inbound'].get(key)
if bool(addr):
logging.debug(f"Refresh: inbound {key} online")
self.refresh = True
# Known inbound offline.
for key in self.known_inbound:
addr = info['inbound'].get(key)
if bool(addr):
if not bool(addr) or not addr == None:
continue
logging.debug(f"Refresh: inbound {key} offline")
logging.debug(f"Refresh: inbound {key} online")
self.refresh = True

# Known inbound offline.
for key in self.known_inbound:
addr = info['inbound'].get(key)
if bool(addr) or addr == None:
continue
logging.debug(f"Refresh: inbound {key} offline")
self.refresh = True

# New outbound online.
if 'outbound' in info:
for i, info in info['outbound'].items():
Expand Down

0 comments on commit 6bf00e5

Please sign in to comment.