From 7f0b8f38d5b62971ff93b266e063d558b4af3347 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 17 Oct 2024 13:09:29 +0800 Subject: [PATCH] orderStore: remove only filled orders and canceled orders --- pkg/core/orderstore.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/core/orderstore.go b/pkg/core/orderstore.go index 05b1995a1..7ba228248 100644 --- a/pkg/core/orderstore.go +++ b/pkg/core/orderstore.go @@ -147,8 +147,10 @@ func (s *OrderStore) Prune(expiryDuration time.Duration) { defer s.mu.Unlock() for idx, o := range s.orders { - if o.UpdateTime.Time().Before(cutOffTime) { - continue + if o.Status == types.OrderStatusCanceled || o.Status == types.OrderStatusFilled { + if o.UpdateTime.Time().Before(cutOffTime) { + continue + } } orders[idx] = o