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 12, 2020
1 parent fcc9c11 commit a41044f
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 @@ -180,8 +180,16 @@ class Stoa extends WebService
}
else
{
preimage_distance = NaN;
result_preimage_hash = Hash.NULL;
if (target_height == new Height(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 @@ -267,8 +275,16 @@ class Stoa extends WebService
}
else
{
preimage_distance = NaN;
result_preimage_hash = Hash.NULL;
if (target_height == new Height(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 a41044f

Please sign in to comment.