diff options
Diffstat (limited to 'internal/casino/blackjack.go')
| -rw-r--r-- | internal/casino/blackjack.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/casino/blackjack.go b/internal/casino/blackjack.go index 55ee702..3b08ba5 100644 --- a/internal/casino/blackjack.go +++ b/internal/casino/blackjack.go @@ -596,8 +596,8 @@ func (t *blackjackTable) settle() []Event { for _, hand := range p.hands { result, payout, settleErr := settleHand(hand, dealerTotal, dealerBlackjack, t.Rules) // One shared settlement path for every game: pay before - // announcing, leave the stakes open on any failure, and resolve - // them only once the payout is durable. + // announcing, and leave the stakes pending on any failure so a + // refund can never be paid on top of a payout that was not durable. if settleStakeOutcome(p.Wallet, payout, hand.stakes, settleErr) { payoutFailed = true publicResult, _ := blackjackResultMessages(p.Name, result, payout) @@ -627,8 +627,8 @@ func (t *blackjackTable) settle() []Event { } } if p.Wallet != nil && !payoutFailed { - // The round resolved; the stakes are no longer outstanding and - // startup recovery must not refund them. + // The round resolved; the stakes are no longer pending and must + // never be refunded. p.Wallet.ResolveStakes() } } @@ -781,8 +781,8 @@ func (t *blackjackTable) markDisconnectedLocked(name string) []Event { } if p := t.players.get(name); p != nil && p.HasBet && p.Wallet != nil { if t.phase == blackjackPlaying || t.phase == blackjackInsurance { - // A disconnected player forfeits the round in flight: resolve the - // stakes now so startup recovery does not refund them later. + // A disconnected player forfeits the round in flight: consume the + // stakes now so a later refund cannot return them. p.Wallet.ResolveStakes() } else { // No card has been dealt for this stake yet, so refund it: nothing @@ -812,7 +812,7 @@ func (t *blackjackTable) markDisconnectedLocked(name string) []Event { } // refundAll refunds every committed wager at this table (graceful -// shutdown/eviction): the wallet returns every outstanding stake — opening +// shutdown/eviction): the wallet returns every pending stake — opening // bet, doubles, splits, and insurance — exactly once. It then RESETS the // round, so a refunded round can never settle (and pay) afterwards: calling // it twice, or letting the table keep running, cannot pay the same round |
