Merge pull request #2920 from hroff-1902/remove-delete-trades

Get rid of delete_trade method in Freqtradebot
This commit is contained in:
Matthias 2020-02-14 07:27:52 +01:00 committed by GitHub
commit 3312fd34f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -860,11 +860,6 @@ class FreqtradeBot:
order_type = self.strategy.order_types['sell'] order_type = self.strategy.order_types['sell']
self._notify_sell_cancel(trade, order_type) self._notify_sell_cancel(trade, order_type)
def delete_trade(self, trade: Trade) -> None:
"""Delete trade in database"""
Trade.session.delete(trade)
Trade.session.flush()
def handle_timedout_limit_buy(self, trade: Trade, order: Dict) -> bool: def handle_timedout_limit_buy(self, trade: Trade, order: Dict) -> bool:
""" """
Buy timeout - cancel order Buy timeout - cancel order
@ -882,7 +877,8 @@ class FreqtradeBot:
if corder.get('remaining', order['remaining']) == order['amount']: if corder.get('remaining', order['remaining']) == order['amount']:
# if trade is not partially completed, just delete the trade # if trade is not partially completed, just delete the trade
self.delete_trade(trade) Trade.session.delete(trade)
Trade.session.flush()
return True return True
# if trade is partially complete, edit the stake details for the trade # if trade is partially complete, edit the stake details for the trade