Skip to content

Commit 5fae4e5

Browse files
author
greensheng
committed
-
1 parent af6198c commit 5fae4e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

matching/order_book.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ func (d *depth) decrSize(orderId int64, size decimal.Decimal) error {
287287
order.Size = order.Size.Sub(size)
288288
if order.Size.IsZero() {
289289
delete(d.orders, orderId)
290-
d.queue.Remove(&priceOrderIdKey{order.Price, order.OrderId})
290+
if d.queue.Empty() {
291+
d.queue.Remove(&priceOrderIdKey{order.Price, order.OrderId})
292+
}
291293
}
292294

293295
return nil

0 commit comments

Comments
 (0)