Fix amount in tip log

This commit is contained in:
moneromooo 2014-12-25 20:43:26 +00:00
parent 15da80978d
commit d3e4b99f99

View file

@ -250,17 +250,17 @@ def Tip(nick,data):
except Exception,e: except Exception,e:
SendTo(sendto, "Usage: tip nick amount") SendTo(sendto, "Usage: tip nick amount")
return return
units=long(amount*coin)
if units <= 0:
SendTo(sendto, "Invalid amount")
return
log_info("Tip: %s wants to tip %s %s" % (nick, who, AmountToString(amount))) log_info("Tip: %s wants to tip %s %s" % (nick, who, AmountToString(units)))
try: try:
balance = redis.hget("balances",nick) balance = redis.hget("balances",nick)
if balance == None: if balance == None:
balance = 0 balance = 0
balance=long(balance) balance=long(balance)
units=long(amount*coin)
if units <= 0:
SendTo(sendto, "Invalid amount")
return
if units > balance: if units > balance:
SendTo(sendto, "You only have %s" % (AmountToString(balance))) SendTo(sendto, "You only have %s" % (AmountToString(balance)))
return return