Record and display winning share difficulty on found blocks

Logmon now captures the share diff from ckpool's "Possible block
solve" line preceding the confirmation and attaches it to the
BlockEvent. Persisted as share_diff alongside height/hash/reward
and rendered as a new column in the dashboard block history.
This commit is contained in:
satoshi
2026-04-14 18:15:44 +03:00
parent 89904d5e08
commit 64d8af407d
5 changed files with 112 additions and 44 deletions
+6 -7
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { snap } from "../stores/snapshot.svelte";
import { formatAgo } from "../format";
import { formatAgo, formatDifficulty } from "../format";
const blocks = $derived.by(() => {
const b = snap.data?.recent_blocks ?? [];
@@ -12,18 +12,16 @@
<section class="card">
<h2>Blocks found</h2>
{#if blocks.length === 0}
<div class="empty">
No blocks found yet. Any solve will appear here instantly via the
log tailer, and persist to SQLite once Phase 2b.5 ships.
</div>
<div class="empty">No blocks found yet.</div>
{:else}
<table>
<thead>
<tr>
<th>Height</th>
<th>Hash</th>
<th class="num">Reward</th>
<th class="num">Winning share</th>
<th class="num">When</th>
<th>Source</th>
</tr>
</thead>
<tbody>
@@ -31,8 +29,9 @@
<tr>
<td class="mono">{b.height}</td>
<td class="hash mono">{b.hash ? b.hash.slice(0, 16) + "…" : "—"}</td>
<td class="num">{b.reward_btc ? b.reward_btc.toFixed(4) + " BTC" : "—"}</td>
<td class="num">{b.share_diff ? formatDifficulty(b.share_diff) : "—"}</td>
<td class="num">{formatAgo(new Date(b.found_at).getTime() / 1000)}</td>
<td>{b.source}</td>
</tr>
{/each}
</tbody>