Verify cancel_order returnvalue is a dictionary

This commit is contained in:
Matthias 2020-03-19 19:43:19 +01:00
parent ecf3a3e070
commit 5e702f6891

View File

@ -891,6 +891,9 @@ class FreqtradeBot:
if order['status'] != 'canceled':
reason = "cancelled due to timeout"
corder = self.exchange.cancel_order(trade.open_order_id, trade.pair)
# Some exchanges don't return a dict here.
if not isinstance(corder, dict):
corder = {}
logger.info('Buy order %s for %s.', reason, trade)
else:
# Order was cancelled already, so we can reuse the existing dict