diff --git a/handler/transactions.py b/handler/transactions.py index 1279ceb..0be9144 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -114,12 +114,19 @@ class Transactions(object): ) self.irc.sendmsg(f"Failed to get reference by amount and currency: {txid} {currency} {amount}") return - if amount > settings.Agora.AcceptableAltLookupUSD: + if currency == "USD": + amount_usd = amount + else: + rates = self.get_rates_all() + amount_usd = amount / rates[currency] + # Amount is reliable here as it is checked by find_trade, so no need for stored_trade["amount"] + if amount_usd > settings.Agora.AcceptableAltLookupUSD: self.log.info("Not checking against amount and currency as amount exceeds MAX") self.irc.sendmsg(f"Not checking against amount and currency as amount exceeds MAX") # Close here if the amount exceeds the allowable limit for no reference return # Note that we have looked it up without reference so we don't use +- below + # This might be redundant given the amount checks in find_trade, but better safe than sorry! looked_up_without_reference = True if not stored_trade: stored_trade = self.get_ref(stored_trade_reference.pop())