Deleting must delete orders first

This commit is contained in:
Matthias
2020-09-06 14:27:36 +02:00
parent b7662722ba
commit a78d61150c
5 changed files with 10 additions and 8 deletions

View File

@@ -1118,8 +1118,7 @@ class FreqtradeBot:
if isclose(filled_amount, 0.0, abs_tol=constants.MATH_CLOSE_PREC):
logger.info('Buy order fully cancelled. Removing %s from database.', trade)
# if trade is not partially completed, just delete the trade
Trade.session.delete(trade)
Trade.session.flush()
trade.delete()
was_trade_fully_canceled = True
else:
# if trade is partially complete, edit the stake details for the trade