You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track payouts + deposits with txids on the admin dashboard
Three new sections on /admin — 'Recent payouts', 'Deposits
(mainchain → Thunder)', 'Recent blocks (coinbase → pool BTC wallet)'
— so operators (and miners on /admin/worker/:id) can trace the full
BTC → Thunder → miner chain by txid.
Schema:
- New 'payouts' table (append-only history). Populated by the
payout worker inside the same atomic transaction that clears
payouts_in_flight and increments pps_credits.paid_sats. Both
schema.sql and the C-side SCHEMA_SQL declare it so a fresh
DB starts complete.
- The existing 'deposits' table (previously a placeholder from
CLASSIC_PAYOUTS.md) is now actively used. scripts/log-deposit.sh
is a tiny CLI to append a row after each manual
CreateDepositTransaction (rejects wrapper-form Thunder addresses
with the same guardrail as thunder_address_decode).
Payout worker:
- finalizePayout now writes one row into 'payouts' per successful
Thunder transfer, in the same SQLite transaction as the
pps_credits UPDATE and the payouts_in_flight DELETE. Preserves
the at-most-once protocol; adds an audit trail.
- Signature gains an explicit fee_sats param (previously hardcoded
100 in TX_FEE_SATS and lost after the tx).
Dashboard:
- lib/admin.js: recentPayouts / payoutsForWorker / recentDeposits /
recentBlocksFound queries. All read-only, join to workers so we
can link to the per-worker audit page from any row.
- server.js: adminSummary now returns payouts + deposits + blocks;
workerAuditFor attaches per-worker payout history.
- views/admin.ejs: three new cards below in-flight, each with a
txid column (truncated with hover-title showing the full hash).
Recent-blocks card notes that the coinbase txid is derivable via
.
- views/admin-worker.ejs: 'Payouts to this worker' card lists every
Thunder tx we've sent this address with full txid + amount + fee.
Verified: 7/7 test suites still green; new schema applies cleanly
(CREATE IF NOT EXISTS on the store side, so live DBs pick up the
'payouts' table on the next simplepool restart).
<p class="muted">No deposits recorded. See<code>OPERATOR_GUIDE.md</code> or use <code>scripts/log-deposit.sh</code> after issuing a CreateDepositTransaction.</p>
0 commit comments