Add the tipbot's personal balance when querying house balance

It's not part of the "spendable" house balance, so must be
accounted for separately.
This commit is contained in:
moneromooo 2015-01-21 14:23:28 +00:00
parent 1726d85d5c
commit 69d0f89549
1 changed files with 5 additions and 1 deletions

View File

@ -244,11 +244,15 @@ def RetrieveHouseBalance():
def GetHouseBalance(link,cmd):
try:
balance = RetrieveHouseBalance()
personal_balance=0
for network in networks:
identity=network.name+':'+config.tipbot_name
personal_balance += long(redis_hget('balances',identity) or 0)
except Exception,e:
log_error('Failed to retrieve house balance: %s' % str(e))
link.send('An error occured')
return
link.send('House balance: %s' % AmountToString(balance))
link.send('House balance: %s, %s personal balance: %s' % (AmountToString(balance), config.tipbot_name, AmountToString(personal_balance)))
def ReserveBalance(link,cmd):
rbal=GetParam(cmd,1)