Merge pull request #231 from zenixls2/binance_cancel

This commit is contained in:
Yo-An Lin 2021-05-12 09:25:34 +08:00 committed by GitHub
commit ca0061856d

View File

@ -47,9 +47,17 @@ func (b *LocalActiveOrderBook) orderUpdateHandler(order types.Order) {
b.EmitFilled(order)
}
case types.OrderStatusPartiallyFilled, types.OrderStatusNew:
case types.OrderStatusPartiallyFilled:
b.Update(order)
case types.OrderStatusNew:
if order.Quantity == 0 {
log.Debugf("[LocalActiveOrderBook] order status %s, removing %d...", order.Status, order.OrderID)
b.Remove(order)
} else {
b.Update(order)
}
case types.OrderStatusCanceled, types.OrderStatusRejected:
log.Debugf("[LocalActiveOrderBook] order status %s, removing %d...", order.Status, order.OrderID)
b.Remove(order)