mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 07:26:47 +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:
@@ -330,6 +330,7 @@ func (h *HitBTC) WsProcessOrderbookSnapshot(ob WsOrderbook) error {
|
||||
newOrderBook.AssetType = asset.Spot
|
||||
newOrderBook.Pair = p
|
||||
newOrderBook.ExchangeName = h.Name
|
||||
newOrderBook.VerificationBypass = h.OrderbookVerificationBypass
|
||||
|
||||
return h.Websocket.Orderbook.LoadSnapshot(&newOrderBook)
|
||||
}
|
||||
|
||||
@@ -165,8 +165,8 @@ func (h *HitBTC) Setup(exch *config.ExchangeConfig) error {
|
||||
UnSubscriber: h.Unsubscribe,
|
||||
GenerateSubscriptions: h.GenerateDefaultSubscriptions,
|
||||
Features: &h.Features.Supports.WebsocketCapabilities,
|
||||
OrderbookBufferLimit: exch.WebsocketOrderbookBufferLimit,
|
||||
BufferEnabled: exch.WebsocketOrderbookBufferEnabled,
|
||||
OrderbookBufferLimit: exch.OrderbookConfig.WebsocketBufferLimit,
|
||||
BufferEnabled: exch.OrderbookConfig.WebsocketBufferEnabled,
|
||||
SortBuffer: true,
|
||||
SortBufferByUpdateIDs: true,
|
||||
})
|
||||
@@ -366,7 +366,12 @@ func (h *HitBTC) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbo
|
||||
|
||||
// UpdateOrderbook updates and returns the orderbook for a currency pair
|
||||
func (h *HitBTC) UpdateOrderbook(c currency.Pair, assetType asset.Item) (*orderbook.Base, error) {
|
||||
book := &orderbook.Base{ExchangeName: h.Name, Pair: c, AssetType: assetType}
|
||||
book := &orderbook.Base{
|
||||
ExchangeName: h.Name,
|
||||
Pair: c,
|
||||
AssetType: assetType,
|
||||
VerificationBypass: h.OrderbookVerificationBypass,
|
||||
}
|
||||
fpair, err := h.FormatExchangeCurrency(c, assetType)
|
||||
if err != nil {
|
||||
return book, err
|
||||
|
||||
Reference in New Issue
Block a user