From 772727b0ef7d63144bf629d774f8b6c1c996bf78 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 21:36:26 +0100 Subject: v2.3.1: settle orphaned reservations on server restart --- AGENTS.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'AGENTS.md') diff --git a/AGENTS.md b/AGENTS.md index be00df5..3f96b7b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,6 +20,12 @@ - Every `PLAY_START` must produce a session entry before the balance is touched. The session is the audit trail for the deduction; without it the deduction is orphaned. +- Multi-step games (blackjack, crash) reserve with `database::reserve_play`: + the debit and the `pending_plays` row are one transaction. Settlement deletes + that row and writes the `plays` row in the same transaction. +- Sweep orphaned reservations only at startup (`recover_orphaned_reservations`), + never per connection. A per-connection sweep would settle another player's + live hand. An orphaned reservation is a forfeit, never a refund. - Clean up sessions on client disconnect. If a game is in progress when the connection drops, settle it as a forfeit (the reserved bet is lost) and record the play; never refund an active hand. -- cgit v1.2.3