orderStore: remove only filled orders and canceled orders

This commit is contained in:
c9s 2024-10-17 13:09:29 +08:00
parent 5fbb06639d
commit 7f0b8f38d5
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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