Don't message if trade release failed

This commit is contained in:
Mark Veidemanis 2022-03-24 20:24:56 +00:00
parent 0094da841e
commit a69a585c71
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 10 additions and 3 deletions

View File

@ -186,10 +186,17 @@ class Transactions(util.Base):
self.ux.notify.notify_complete_trade(amount, currency) self.ux.notify.notify_complete_trade(amount, currency)
def release_funds(self, trade_id, reference): def release_funds(self, trade_id, reference):
self.log.info(f"All checks passed, releasing funds for {trade_id} {reference}") logmessage = f"All checks passed, releasing funds for {trade_id} {reference}"
self.irc.sendmsg(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) 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 # Parse the escrow release response
message = rtrn["message"] message = rtrn["message"]