core: add comment to the remove condition

This commit is contained in:
c9s 2024-10-22 11:59:02 +08:00
parent 86360a7595
commit 15b179a47d
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -147,6 +147,7 @@ func (s *OrderStore) Prune(expiryDuration time.Duration) {
defer s.mu.Unlock() defer s.mu.Unlock()
for idx, o := range s.orders { for idx, o := range s.orders {
// if the order is canceled or filled, we should remove the order if the update time is before the cut off time
if o.Status == types.OrderStatusCanceled || o.Status == types.OrderStatusFilled { if o.Status == types.OrderStatusCanceled || o.Status == types.OrderStatusFilled {
if o.UpdateTime.Time().Before(cutOffTime) { if o.UpdateTime.Time().Before(cutOffTime) {
continue continue