From a69a585c71c9767fda8b098baf7b35e89f909db6 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 24 Mar 2022 20:24:56 +0000 Subject: [PATCH] Don't message if trade release failed --- handler/transactions.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/handler/transactions.py b/handler/transactions.py index 65973d4..1c5637b 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -186,10 +186,17 @@ class Transactions(util.Base): self.ux.notify.notify_complete_trade(amount, currency) def release_funds(self, trade_id, reference): - self.log.info(f"All checks passed, releasing funds for {trade_id} {reference}") - self.irc.sendmsg(f"All checks passed, releasing funds for {trade_id} / {reference}") + logmessage = f"All checks passed, releasing funds for {trade_id} {reference}" + self.log.info(logmessage) + self.irc.sendmsg(logmessage) rtrn = self.agora.release_funds(trade_id) - self.agora.agora.contact_message_post(trade_id, "Thanks! Releasing now :)") + if rtrn["message"] == "OK": + self.agora.agora.contact_message_post(trade_id, "Thanks! Releasing now :)") + else: + logmessage = f"Release funds unsuccessful: {rtrn['message']}" + self.log.error(logmessage) + self.irc.sendmsg(logmessage) + return # Parse the escrow release response message = rtrn["message"]