Skip to content

Commit

Permalink
Using node.serving_domain as a workaround for nucypher#2356
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Oct 16, 2020
1 parent 3ffba5c commit 06d32b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nucypher/network/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,10 @@ def read_nodes_from_storage(self) -> List:
restored_from_disk = []
invalid_nodes = defaultdict(list)
for node in stored_nodes:
node_domain = node.domain.decode('utf-8')
try: # Workaround until #2356 is fixed
node_domain = node.domain.decode('utf-8')
except:
node_domain = node.serving_domain
if node_domain != self.learning_domain:
invalid_nodes[node_domain].append(node)
continue
Expand Down Expand Up @@ -520,7 +523,7 @@ def cycle_teacher_node(self):
except IndexError:
error = "Not enough nodes to select a good teacher, Check your network connection then node configuration"
raise self.NotEnoughTeachers(error)
self.log.info("Cycled teachers; New teacher is {}".format(self._current_teacher_node))
self.log.debug("Cycled teachers; New teacher is {}".format(self._current_teacher_node))

def current_teacher_node(self, cycle=False):
if cycle:
Expand Down Expand Up @@ -1359,7 +1362,7 @@ def node_details(node):
"last_seen": last_seen,
"fleet_state": node.fleet_state_checksum or 'unknown',
"fleet_state_icon": fleet_icon,
"domain": node.learning_domain,
"domain": node.serving_domain,
'version': nucypher.__version__}
return payload

Expand Down

0 comments on commit 06d32b4

Please sign in to comment.