From 69dde55a21ec964cffbf73f1cf9d4e4b6398b490 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 13 Feb 2022 23:01:44 +0000 Subject: [PATCH] Fix TX update logic in Transactions --- handler/transactions.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/handler/transactions.py b/handler/transactions.py index 5c3b1b0..14ad2f7 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -37,14 +37,6 @@ class Transactions(object): inside = data["data"] txid = inside["id"] - try: - txtype = inside["type"] - except KeyError: - self.log.error("Typeless event: {id}", id=txid) - return - if txtype == "card_payment": - self.log.info("Ignoring card payment: {id}", id=txid) - return if "type" not in inside: stored_trade = r.hgetall(f"tx.{txid}") @@ -75,6 +67,11 @@ class Transactions(object): return # If type not in inside and we haven't hit any more returns return + else: + txtype = inside["type"] + if txtype == "card_payment": + self.log.info("Ignoring card payment: {id}", id=txid) + return state = inside["state"] if "reference" in inside: