From 32a3c59cebf2a16277e54d715a67adfdbe00b456 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 17 Sep 2026 22:00:33 -0400 Subject: fix: exact casino settlement/refund coverage, journal damage handling, craft output ordering, aggregate ingredient planning --- internal/casino/machine.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/casino/machine.go') diff --git a/internal/casino/machine.go b/internal/casino/machine.go index 757588b..0f137ec 100644 --- a/internal/casino/machine.go +++ b/internal/casino/machine.go @@ -428,9 +428,11 @@ func (m *Machine) menuEvents(prefix string) []Event { // refundAll refunds any outstanding stake at graceful shutdown/eviction. // The wallet resolves every outstanding stake exactly once; a completed // spin has no outstanding stake and is not refunded again. A stake whose -// payout failed to persist (stakeFailed) is refunded here as well — its -// owed settlement remains open separately and startup recovery re-applies -// it. A bonus in progress keeps its triggering stake outstanding, so a +// payout failed to persist (stakeFailed) is NOT returned here when an open +// payout record covers it — the journaled winnings prove the round +// resolved, so the stake was consumed by playing it and recovery re-applies +// the owed payout instead of double-paying the round. A bonus in progress +// keeps its triggering stake outstanding with no payout journaled, so a // shutdown during the feature returns the stake (the remaining free-spin // EV is forfeit, never the wager). Locked. func (m *Machine) refundAll() []Event { -- cgit v1.2.3