mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
binance: fix order cancel client order id usage
This commit is contained in:
parent
c284e2e3bb
commit
6c3ee314d9
|
@ -548,7 +548,6 @@ func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) (err
|
||||||
|
|
||||||
_, _err := req.Do(ctx)
|
_, _err := req.Do(ctx)
|
||||||
if _err != nil {
|
if _err != nil {
|
||||||
log.WithError(_err).Errorf("order cancel error")
|
|
||||||
err = multierr.Append(err, _err)
|
err = multierr.Append(err, _err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -565,13 +564,12 @@ func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) (err
|
||||||
if o.OrderID > 0 {
|
if o.OrderID > 0 {
|
||||||
req.OrderID(int64(o.OrderID))
|
req.OrderID(int64(o.OrderID))
|
||||||
} else if len(o.ClientOrderID) > 0 {
|
} else if len(o.ClientOrderID) > 0 {
|
||||||
req.NewClientOrderID(o.ClientOrderID)
|
req.OrigClientOrderID(o.ClientOrderID)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _err := req.Do(ctx)
|
_, err2 := req.Do(ctx)
|
||||||
if _err != nil {
|
if err2 != nil {
|
||||||
log.WithError(_err).Errorf("order cancel error")
|
err = multierr.Append(err, err2)
|
||||||
err = multierr.Append(err, _err)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var req = e.Client.NewCancelOrderService()
|
var req = e.Client.NewCancelOrderService()
|
||||||
|
@ -580,13 +578,12 @@ func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) (err
|
||||||
if o.OrderID > 0 {
|
if o.OrderID > 0 {
|
||||||
req.OrderID(int64(o.OrderID))
|
req.OrderID(int64(o.OrderID))
|
||||||
} else if len(o.ClientOrderID) > 0 {
|
} else if len(o.ClientOrderID) > 0 {
|
||||||
req.NewClientOrderID(o.ClientOrderID)
|
req.OrigClientOrderID(o.ClientOrderID)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _err := req.Do(ctx)
|
_, err2 := req.Do(ctx)
|
||||||
if _err != nil {
|
if err2 != nil {
|
||||||
log.WithError(_err).Errorf("order cancel error")
|
err = multierr.Append(err, err2)
|
||||||
err = multierr.Append(err, _err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user