mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +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 order update time is too old, skip it
|
||||||
if previousOrder, ok := b.orders.Get(order.OrderID); ok {
|
if previousOrder, ok := b.orders.Get(order.OrderID); ok {
|
||||||
previousUpdateTime := previousOrder.UpdateTime.Time()
|
if isNewerOrderUpdate(previousOrder, order) {
|
||||||
if !previousUpdateTime.IsZero() && order.UpdateTime.Before(previousUpdateTime) {
|
|
||||||
log.Infof("[ActiveOrderBook] order #%d updateTime %s is out of date, skip it", order.OrderID, order.UpdateTime)
|
log.Infof("[ActiveOrderBook] order #%d updateTime %s is out of date, skip it", order.OrderID, order.UpdateTime)
|
||||||
b.mu.Unlock()
|
b.mu.Unlock()
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user