Avoid crash with /delete

When a trade is deleted between querying the database and actually
handling the trade.

closes #4326
This commit is contained in:
Matthias 2021-02-18 12:49:14 +01:00
parent 327c23618f
commit 2b0d2070d0

View File

@ -179,6 +179,7 @@ class FreqtradeBot(LoggingMixin):
# Without this, freqtrade my try to recreate stoploss_on_exchange orders
# while selling is in process, since telegram messages arrive in an different thread.
with self._sell_lock:
trades = Trade.get_open_trades()
# First process current opened trades (positions)
self.exit_positions(trades)