diff options
Diffstat (limited to 'internal/casino/core.go')
| -rw-r--r-- | internal/casino/core.go | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/internal/casino/core.go b/internal/casino/core.go index 0b9d0af..7143841 100644 --- a/internal/casino/core.go +++ b/internal/casino/core.go @@ -143,11 +143,7 @@ func resolveStakeIDs(w Wallet, ids []string) { if w == nil { return } - for _, id := range ids { - if id != "" { - w.ResolveStake(id) - } - } + w.ResolveStakesByIDs(ids...) } // settleStakeOutcome applies one wager's outcome through the wallet and @@ -175,12 +171,10 @@ func settleStakeOutcome(w Wallet, payout int, stakeIDs []string, payoutErr error if payout > 0 { return w.PayCredits(payout, stakeIDs...) != nil } - // A zero payout is a loss: consume the stakes so recovery cannot refund a - // round that resolved. - for _, id := range stakeIDs { - if id != "" { - w.ResolveStake(id) - } + // A zero payout is a loss: consume the stakes in one save so recovery can + // never refund a round that resolved. + if w != nil { + w.ResolveStakesByIDs(stakeIDs...) } return false } |
