mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
bbgo: replace update time check with isNewerOrderUpdate func call
This commit is contained in:
parent
6b27722b03
commit
326a0c6128
|
@ -276,8 +276,7 @@ func (b *ActiveOrderBook) Update(order types.Order) {
|
|||
|
||||
// if order update time is too old, skip it
|
||||
if previousOrder, ok := b.orders.Get(order.OrderID); ok {
|
||||
previousUpdateTime := previousOrder.UpdateTime.Time()
|
||||
if !previousUpdateTime.IsZero() && order.UpdateTime.Before(previousUpdateTime) {
|
||||
if isNewerOrderUpdate(previousOrder, order) {
|
||||
log.Infof("[ActiveOrderBook] order #%d updateTime %s is out of date, skip it", order.OrderID, order.UpdateTime)
|
||||
b.mu.Unlock()
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user