Skip to content

Commit

Permalink
Fix the preimage display at height=0
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustHenry committed Nov 13, 2020
1 parent dfc3984 commit 9d6564c
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/Stoa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,16 @@ class Stoa extends WebService
}
else
{
preimage_distance = NaN;
result_preimage_hash = Hash.NULL;
if (target_height.value == row.enrolled_at)
{
preimage_distance = 0;
result_preimage_hash = row.random_seed;
}
else
{
preimage_distance = NaN;
result_preimage_hash = Hash.NULL;
}
}

let preimage: IPreimage = {
Expand Down Expand Up @@ -270,8 +278,16 @@ class Stoa extends WebService
}
else
{
preimage_distance = NaN;
result_preimage_hash = Hash.NULL;
if (target_height.value == row.enrolled_at)
{
preimage_distance = 0;
result_preimage_hash = row.random_seed;
}
else
{
preimage_distance = NaN;
result_preimage_hash = Hash.NULL;
}
}

let preimage: IPreimage = {
Expand Down

0 comments on commit 9d6564c

Please sign in to comment.