-) Removed pendingOrders from BfxWebsocket() (it was not used anywhere)

-) Fixed issue in confirm_order_new() (the keys of the dict pending_orders are the cids of the orders, and not the ids)
This commit is contained in:
Dario Moceri
2021-03-15 16:18:15 +01:00
committed by Robert Kowalski
parent e39ed1c491
commit 50c52b77ab
5 changed files with 10 additions and 5 deletions

View File

@@ -78,8 +78,8 @@ class OrderManager:
async def confirm_order_new(self, raw_ws_data):
order = Order.from_raw_order(raw_ws_data[2])
order.set_open_state(True)
if order.id in self.pending_orders:
del self.pending_orders[order.id]
if order.cid in self.pending_orders:
del self.pending_orders[order.cid]
self.open_orders[order.id] = order
order.set_confirmed()
self.bfxapi._emit('order_confirmed', order)
@@ -270,3 +270,5 @@ class OrderManager:
def _gen_unique_cid(self):
return gen_unique_cid()