mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
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.
This commit is contained in:
parent
e2787cc2b3
commit
00b742445e
1 changed files with 2 additions and 0 deletions
|
@ -390,6 +390,8 @@ def Result(link,cmd):
|
||||||
ounits = long(redis_hget(tname,bettor+":units"))
|
ounits = long(redis_hget(tname,bettor+":units"))
|
||||||
if o == outcome:
|
if o == outcome:
|
||||||
owinunits = long(total_units_bet * (1-config.bookie_fee) * ounits / total_units_bet_by_winners)
|
owinunits = long(total_units_bet * (1-config.bookie_fee) * ounits / total_units_bet_by_winners)
|
||||||
|
if owinunits<ounits:
|
||||||
|
owinunits=units
|
||||||
resultmsg.append("%s wins %s" % (NickFromIdentity(bettor), AmountToString(owinunits)))
|
resultmsg.append("%s wins %s" % (NickFromIdentity(bettor), AmountToString(owinunits)))
|
||||||
p.hincrby("balances",bettor,owinunits)
|
p.hincrby("balances",bettor,owinunits)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue