From d95a1ae21fc9a7b8c43ad54a0a8c336dd204c5f6 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 17 May 2022 18:25:31 +0100 Subject: [PATCH] Fix calls to money --- handler/lib/money.py | 2 ++ handler/sources/agora.py | 2 +- handler/sources/localbitcoins.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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