summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Rhinelander <jason@imaginary.ca>2020-09-03 00:26:38 -0300
committerJason Rhinelander <jason@imaginary.ca>2020-09-03 00:26:38 -0300
commit300a985657153a629b0977da16be0a3bbe8c6a62 (patch)
treeb166635dcd82c9525f8ddd3e8194cbec8d2e6b0a
parent4a157d980fa5f957f27c7e5ee790b82a966e0615 (diff)
Misc. fixes
-rw-r--r--observer.py4
-rw-r--r--templates/sn.html10
-rw-r--r--templates/tx.html2
3 files changed, 8 insertions, 8 deletions
diff --git a/observer.py b/observer.py
index 583b396..ac48735 100644
--- a/observer.py
+++ b/observer.py
@@ -163,7 +163,7 @@ def get_sns_future(lmq, lokid):
'last_reward_transaction_index', 'active', 'funded', 'earned_downtime_blocks',
'service_node_version', 'contributors', 'total_contributed', 'total_reserved',
'staking_requirement', 'portions_for_operator', 'operator_address', 'pubkey_ed25519',
- 'last_uptime_proof', 'service_node_version') } })
+ 'last_uptime_proof', 'service_node_version', 'state_height') } })
def get_sns(sns_future, info_future):
info = info_future.get()
@@ -369,7 +369,7 @@ def show_sn(pubkey):
# These are a bit non-trivial to properly calculate:
# Number of staked contributions
- sn['num_contributions'] = sum(len(x["locked_contributions"]) for x in sn["contributors"])
+ sn['num_contributions'] = sum(len(x["locked_contributions"]) for x in sn["contributors"] if "locked_contributions" in x)
# Number of unfilled, reserved contribution spots:
sn['num_reserved_spots'] = sum(x["amount"] < x["reserved"] for x in sn["contributors"])
# Available open contribution spots:
diff --git a/templates/sn.html b/templates/sn.html
index c5e595d..5feb46a 100644
--- a/templates/sn.html
+++ b/templates/sn.html
@@ -50,7 +50,7 @@
<span><label>Total contributed:</label>
{%if sn.total_contributed >= sn.staking_requirement%}100%
{%else%}
- {{sn.total_contributed | loki}} ({{(sn.total_contributed / sn.staking_requirement) * 100 | round(2) | chop0}}%)
+ {{sn.total_contributed | loki}} ({{(sn.total_contributed / sn.staking_requirement * 100) | round(2) | chop0}}%)
{%endif%}
</span>
@@ -97,7 +97,7 @@
{%endif%}
</p>
{%else%}
- <p class="sn-awaiting">Awaiting registration. This service node has <span class="loki required">{{(sn.staking_requirement - total_contributed) | loki}}</span>
+ <p class="sn-awaiting">Awaiting registration. This service node has <span class="loki required">{{(sn.staking_requirement - sn.total_contributed) | loki}}</span>
remaining to be contributed.
{%if sn.num_open_spots > 0%}
The minimum required stake contribution is <span class="loki required">{{((sn.staking_requirement - sn.total_reserved) / sn.num_open_spots) | loki}}</span>.
@@ -107,9 +107,9 @@
<p class="sn-expiration{%if sn.requested_unlock_height > 0%} unlocking{%endif%}">
{%if sn.requested_unlock_height > 0%}
- This service node is scheduled to expire at block {{sn.requested_unlock_height}}, in approximately
- {{(sn.requested_unlock_height - info.height + 1) * 120 | reltime(in_ago=false) }}
- ({{(server.datetime + ((sn.requested_unlock_height - info.height + 1) * 120)|from_timestamp) | format_datetime('short')}} UTC, est.)
+ This service node is <span class="omg">scheduled to expire at block {{sn.requested_unlock_height}}</span>, in approximately
+ {{((sn.requested_unlock_height - info.height + 1) * 120) | reltime(in_ago=false) }}
+ ({{(server.timestamp + (sn.requested_unlock_height - info.height + 1) * 120) | from_timestamp | format_datetime('short')}} UTC, est.)
{%else%}
This service node is staking infinitely: no unlock has been initiated by any of its contributors.
{%endif%}
diff --git a/templates/tx.html b/templates/tx.html
index 98f7ae7..bd141ea 100644
--- a/templates/tx.html
+++ b/templates/tx.html
@@ -137,7 +137,7 @@
{% elif 'sn_registration' in tx.extra %}
<h2>🏁 Service Node Register Metadata</h2>
<div class="TitleDivider"></div>
- <p><label>Service Node Public Key:</label> {{tx.extra.sn_pubkey}}</p>
+ <p><label>Service Node Public Key:</label> <a href="/sn/{{tx.extra.sn_pubkey}}">{{tx.extra.sn_pubkey}}</a></p>
<p><label>Operator fee:</label>
{%if tx.extra.sn_registration.fee == 1000000%}N/A (solo registration)
{%else%}{{(tx.extra.sn_registration.fee / 10000) | chop0}}%