From d99eaccb5a6d87a27aacc9107140db09e570e46d Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 5 Nov 2021 19:47:13 +0100 Subject: [PATCH] Fix exception when using okex closes #5842 --- freqtrade/freqtradebot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index d23ba270d..a1e8cad4a 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1281,6 +1281,11 @@ class FreqtradeBot(LoggingMixin): trade.update_order(order) + if self.exchange.check_order_canceled_empty(order): + # Trade has been cancelled on exchange + # Handling of this will happen in check_handle_timeout. + return True + # Try update amount (binance-fix) try: new_amount = self.get_real_amount(trade, order) @@ -1292,10 +1297,6 @@ class FreqtradeBot(LoggingMixin): except DependencyException as exception: logger.warning("Could not update trade amount: %s", exception) - if self.exchange.check_order_canceled_empty(order): - # Trade has been cancelled on exchange - # Handling of this will happen in check_handle_timeout. - return True trade.update(order) Trade.commit()