From 816161cc3f85e601723118c3789b3355d56ebd42 Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Tue, 29 Oct 2024 21:11:37 +0100 Subject: [PATCH] Fix get block template --- src/app/pages/mining/mining.component.html | 51 ++++++++++++++++++++++ src/common/BlockTemplate.ts | 4 ++ 2 files changed, 55 insertions(+) diff --git a/src/app/pages/mining/mining.component.html b/src/app/pages/mining/mining.component.html index a137851..6440f51 100644 --- a/src/app/pages/mining/mining.component.html +++ b/src/app/pages/mining/mining.component.html @@ -203,6 +203,57 @@ +
+
+

Block Template

+
+
+ +
+
+
Block Template Blob
+

{{ blockTemplate.blockTemplateBlob }}

+
+
+ +
+
+
Block Header
+
+
+
    +
  • Block Hashing Blob: {{ blockTemplate.blockHashingBlob }} bytes
  • +
  • Height: {{ blockTemplate.height }}
  • +
  • Previous Hash: {{ blockTemplate.prevHash }}
  • +
  • Expected Reward: {{ blockTemplate.expectedRewardXMR }} XMR
  • +
  • Difficulty: {{ blockTemplate.difficulty }}
  • +
  • Wide Difficulty: {{ blockTemplate.wideDifficulty }}
  • +
  • Reserved Offset: {{ blockTemplate.reservedOffset }}
  • +
+
+
+
+
+ +
+
+
Seed
+
+
+
    +
  • Seed Hash: {{ blockTemplate.seedHash }}
  • +
  • Seed Height: {{ blockTemplate.seedHeight }}
  • +
  • Next Seed Hash: {{ blockTemplate.nextSeedHash }}
  • +
+
+
+
+
+
+
+ +
+
diff --git a/src/common/BlockTemplate.ts b/src/common/BlockTemplate.ts index 6a754ad..215a115 100644 --- a/src/common/BlockTemplate.ts +++ b/src/common/BlockTemplate.ts @@ -14,6 +14,10 @@ export class BlockTemplate { public readonly untrusted: boolean; public readonly wideDifficulty: string; + public get expectedRewardXMR(): number { + return this.expectedReward / 1e12; + } + constructor(blockHashingBlob: string, blockTemplateBlob: string, difficulty: number, difficultyTop64: number, expectedReward: number, height: number, nextSeedHash: string, prevHash: string, reservedOffset: number, seedHash: string, seedHeight: number, status: string, untrusted: boolean, wideDifficulty: string) { this.blockHashingBlob = blockHashingBlob; this.blockTemplateBlob = blockTemplateBlob;