failure for stale nodes who unsubscribe between polls
@@ -188,6 +188,7 @@ class Metagraph():
info from the local pubkey -> index mapping.
"""
+ try:
current_block = self.substrate.get_block_number(None)
if pubkey in self._pubkey_index_map:
index = self._pubkey_index_map[0]
@@ -244,7 +245,9 @@ class Metagraph():
self._weight_keys.append( list(w_keys) )
self._weight_vals.append( list(w_vals) )
self._poll_list.append( current_block )
-
+ except Exception as e:
+ # Failure here if the node data is corrupted.
+ pass
def _build_torch_tensors(self):
""" Builds torch objects from python polled state.
