mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-03 15:10:49 +00:00
Exchanges: Add config variable to set bypassing of orderbook verification by exchange (#614)
* Exchanges: Add config variable to set bypassing of orderbook verification * Exchanges: Consolidate orderbook variables into config struct * Exchanges: Addr nit; set verification bypass on websocket book implementations
This commit is contained in:
@@ -147,6 +147,7 @@ func (z *ZB) wsHandleData(respRaw []byte) error {
|
||||
book.AssetType = asset.Spot
|
||||
book.Pair = cPair
|
||||
book.ExchangeName = z.Name
|
||||
book.VerificationBypass = z.OrderbookVerificationBypass
|
||||
|
||||
err = z.Websocket.Orderbook.LoadSnapshot(&book)
|
||||
if err != nil {
|
||||
|
||||
@@ -166,8 +166,8 @@ func (z *ZB) Setup(exch *config.ExchangeConfig) error {
|
||||
GenerateSubscriptions: z.GenerateDefaultSubscriptions,
|
||||
Subscriber: z.Subscribe,
|
||||
Features: &z.Features.Supports.WebsocketCapabilities,
|
||||
OrderbookBufferLimit: exch.WebsocketOrderbookBufferLimit,
|
||||
BufferEnabled: exch.WebsocketOrderbookBufferEnabled,
|
||||
OrderbookBufferLimit: exch.OrderbookConfig.WebsocketBufferLimit,
|
||||
BufferEnabled: exch.OrderbookConfig.WebsocketBufferEnabled,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -292,7 +292,12 @@ func (z *ZB) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.B
|
||||
|
||||
// UpdateOrderbook updates and returns the orderbook for a currency pair
|
||||
func (z *ZB) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {
|
||||
book := &orderbook.Base{ExchangeName: z.Name, Pair: p, AssetType: assetType}
|
||||
book := &orderbook.Base{
|
||||
ExchangeName: z.Name,
|
||||
Pair: p,
|
||||
AssetType: assetType,
|
||||
VerificationBypass: z.OrderbookVerificationBypass,
|
||||
}
|
||||
currFormat, err := z.FormatExchangeCurrency(p, assetType)
|
||||
if err != nil {
|
||||
return book, err
|
||||
|
||||
Reference in New Issue
Block a user