diff --git a/handler/lib/money.py b/handler/lib/money.py index 4822ba6..ed741a2 100644 --- a/handler/lib/money.py +++ b/handler/lib/money.py @@ -409,6 +409,8 @@ class Money(util.Base): if asset == "XMR": amount_crypto = contact["data"]["amount_xmr"] history = self.cg.get_coin_history_by_id(id="monero", date=date_formatted) + if "market_data" not in history: + return False crypto_usd = float(history["market_data"]["current_price"]["usd"]) elif asset == "BTC": amount_crypto = contact["data"]["amount_btc"] diff --git a/handler/sources/agora.py b/handler/sources/agora.py index 02897ea..abbef85 100644 --- a/handler/sources/agora.py +++ b/handler/sources/agora.py @@ -59,7 +59,7 @@ class Agora(sources.local.Local): """ Withdraw excess funds to our XMR wallets. """ - totals_all = self.tx.get_total() + totals_all = self.money.get_total() if totals_all is False: return False diff --git a/handler/sources/localbitcoins.py b/handler/sources/localbitcoins.py index 0ba2c9d..a7ba938 100644 --- a/handler/sources/localbitcoins.py +++ b/handler/sources/localbitcoins.py @@ -62,7 +62,7 @@ class LBTC(sources.local.Local): """ Withdraw excess funds to our XMR wallets. """ - totals_all = self.tx.get_total() + totals_all = self.money.get_total() if totals_all is False: return False