Don't overwrite cancel_reason

This commit is contained in:
Matthias 2020-08-26 21:24:47 +02:00
parent d161b94d72
commit add78414e4
2 changed files with 3 additions and 1 deletions

View File

@ -341,6 +341,7 @@ CANCEL_REASON = {
"PARTIALLY_FILLED": "partially filled - keeping order open",
"ALL_CANCELLED": "cancelled (all unfilled and partially filled open orders cancelled)",
"CANCELLED_ON_EXCHANGE": "cancelled on exchange",
"FORCE_SELL": "forcesold",
}
# List of pairs with their timeframes

View File

@ -974,7 +974,8 @@ class FreqtradeBot:
# Cancelled orders may have the status of 'canceled' or 'closed'
if order['status'] not in ('canceled', 'closed'):
reason = constants.CANCEL_REASON['TIMEOUT']
# TODO: this reason will overwrite the input in all cases
# reason = constants.CANCEL_REASON['TIMEOUT']
corder = self.exchange.cancel_order_with_result(trade.open_order_id, trade.pair,
trade.amount)
# Avoid race condition where the order could not be cancelled coz its already filled.