Invalid orders should be removed from pending_orders (#126)

* Invalid orders should be removed from pending_orders

* If an EXCHANGE_FILL_OR_KILL order is unfilled and cancelled, confirm_order_new will not get called. This can leave lots of pending orders remaining in the order_manager.

However, confirm_order_closed will get called, and therefore we should delete pending orders from that method as well.
* updated CHANGELOG
This commit is contained in:
Dario Moceri
2021-04-09 16:20:08 +02:00
committed by GitHub
parent 3d4847934d
commit d198ccb7a7
4 changed files with 17 additions and 1 deletions

View File

@@ -314,6 +314,7 @@ class BfxWebsocket(GenericWebsocket):
notificationText = nInfo[7]
if notificationType == 'ERROR':
# self._emit('error', notificationText)
await self._order_error_handler(data)
self.logger.error(
"Notification ERROR: {}".format(notificationText))
else:
@@ -327,6 +328,9 @@ class BfxWebsocket(GenericWebsocket):
async def _order_closed_handler(self, data):
await self.orderManager.confirm_order_closed(data)
async def _order_error_handler(self, data):
await self.orderManager.confirm_order_error(data)
async def _order_update_handler(self, data):
await self.orderManager.confirm_order_update(data)