diff --git a/tipbot/betutils.py b/tipbot/betutils.py index 829c3b7..5168e36 100644 --- a/tipbot/betutils.py +++ b/tipbot/betutils.py @@ -264,8 +264,8 @@ def ResetGameStats(link,sidentity,game): log_error('Error resetting %s stats for %s: %s' % (game,sidentity,str(e))) raise -def RetrieveHouseBalance(): - balance, unlocked_balance = RetrieveTipbotBalance() +def RetrieveHouseBalance(force_refresh=False): + balance, unlocked_balance = RetrieveTipbotBalance(force_refresh) house_balance = unlocked_balance user_balances=0 diff --git a/tipbot/utils.py b/tipbot/utils.py index 58d9554..ebd564f 100644 --- a/tipbot/utils.py +++ b/tipbot/utils.py @@ -188,9 +188,9 @@ def SendDaemonJSONRPCCommand(method,params): def SendDaemonHTMLCommand(method): return SendHTMLCommand(config.daemon_host,config.daemon_port,method) -def RetrieveTipbotBalance(): +def RetrieveTipbotBalance(force_refresh=False): global cached_tipbot_balance, cached_tipbot_unlocked_balance, cached_tipbot_balance_timestamp - if cached_tipbot_balance_timestamp and time.time()-cached_tipbot_balance_timestamp < config.tipbot_balance_cache_time: + if not force_refresh and cached_tipbot_balance_timestamp and time.time()-cached_tipbot_balance_timestamp < config.tipbot_balance_cache_time: return cached_tipbot_balance, cached_tipbot_unlocked_balance j = SendWalletJSONRPCCommand("getbalance",None)