From 00b742445e66bd04c1a071d68bf2d5eb3b07edd1 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Tue, 27 Jan 2015 22:13:11 +0000 Subject: [PATCH] bookie: ensure a winner player never gets less than his/her bet This could conceivably happen in a game where one side bets a lot more than the other side. --- tipbot/modules/bookie.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tipbot/modules/bookie.py b/tipbot/modules/bookie.py index 64ea222..4709ab8 100644 --- a/tipbot/modules/bookie.py +++ b/tipbot/modules/bookie.py @@ -390,6 +390,8 @@ def Result(link,cmd): ounits = long(redis_hget(tname,bettor+":units")) if o == outcome: owinunits = long(total_units_bet * (1-config.bookie_fee) * ounits / total_units_bet_by_winners) + if owinunits