summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Rhinelander <jason@imaginary.ca>2020-09-11 17:43:00 -0300
committerJason Rhinelander <jason@imaginary.ca>2020-09-11 17:43:00 -0300
commit684c600803d66326bdf20e3644e0fb8db4da4d50 (patch)
tree8916907deedb250eb643e4cbe8b765fdf1ddc6cb
parent300a985657153a629b0977da16be0a3bbe8c6a62 (diff)
Fix exception when no SNs
-rw-r--r--observer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/observer.py b/observer.py
index ac48735..4a697dd 100644
--- a/observer.py
+++ b/observer.py
@@ -168,7 +168,8 @@ def get_sns_future(lmq, lokid):
def get_sns(sns_future, info_future):
info = info_future.get()
awaiting_sns, active_sns, inactive_sns = [], [], []
- sn_states = sns_future.get()['service_node_states']
+ sn_states = sns_future.get()
+ sn_states = sn_states['service_node_states'] if 'service_node_states' in sn_states else []
for sn in sn_states:
sn['contribution_open'] = sn['staking_requirement'] - sn['total_reserved']
sn['contribution_required'] = sn['staking_requirement'] - sn['total_contributed']