Fix err check

This commit is contained in:
Adrian Gallagher
2018-01-29 17:13:26 +11:00
parent 53b80f8bd4
commit 2e1b5afd94
19 changed files with 20 additions and 20 deletions

View File

@@ -81,7 +81,7 @@ func (a *Alphapoint) UpdateOrderbook(p pair.CurrencyPair, assetType string) (ord
// GetOrderbookEx returns the orderbook for a currency pair
func (a *Alphapoint) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(a.GetName(), p, assetType)
if err == nil {
if err != nil {
return a.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -102,7 +102,7 @@ func (a *ANX) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Pric
// GetOrderbookEx returns the orderbook for a currency pair
func (a *ANX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(a.GetName(), p, assetType)
if err == nil {
if err != nil {
return a.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -70,7 +70,7 @@ func (b *Bitfinex) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker
// GetOrderbookEx returns the orderbook for a currency pair
func (b *Bitfinex) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(b.GetName(), p, assetType)
if err == nil {
if err != nil {
return b.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -59,7 +59,7 @@ func (b *Bitstamp) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker
// GetOrderbookEx returns the orderbook for a currency pair
func (b *Bitstamp) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(b.GetName(), p, assetType)
if err == nil {
if err != nil {
return b.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -102,7 +102,7 @@ func (b *Bittrex) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.
// GetOrderbookEx returns the orderbook for a currency pair
func (b *Bittrex) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(b.GetName(), p, assetType)
if err == nil {
if err != nil {
return b.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -91,7 +91,7 @@ func (b *BTCC) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Pri
// GetOrderbookEx returns the orderbook for a currency pair
func (b *BTCC) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(b.GetName(), p, assetType)
if err == nil {
if err != nil {
return b.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -77,7 +77,7 @@ func (b *BTCMarkets) GetTickerPrice(p pair.CurrencyPair, assetType string) (tick
// GetOrderbookEx returns orderbook base on the currency pair
func (b *BTCMarkets) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(b.GetName(), p, assetType)
if err == nil {
if err != nil {
return b.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -98,7 +98,7 @@ func (c *COINUT) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.P
// GetOrderbookEx returns orderbook base on the currency pair
func (c *COINUT) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(c.GetName(), p, assetType)
if err == nil {
if err != nil {
return c.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -99,7 +99,7 @@ func (g *GDAX) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Pri
// GetOrderbookEx returns orderbook base on the currency pair
func (g *GDAX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(g.GetName(), p, assetType)
if err == nil {
if err != nil {
return g.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -80,7 +80,7 @@ func (g *Gemini) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.P
// GetOrderbookEx returns orderbook base on the currency pair
func (g *Gemini) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(g.GetName(), p, assetType)
if err == nil {
if err != nil {
return g.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -58,7 +58,7 @@ func (h *HUOBI) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Pr
// GetOrderbookEx returns orderbook base on the currency pair
func (h *HUOBI) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(h.GetName(), p, assetType)
if err == nil {
if err != nil {
return h.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -55,7 +55,7 @@ func (i *ItBit) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Pr
// GetOrderbookEx returns orderbook base on the currency pair
func (i *ItBit) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(i.GetName(), p, assetType)
if err == nil {
if err != nil {
return i.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -145,7 +145,7 @@ func (k *Kraken) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.P
// GetOrderbookEx returns orderbook base on the currency pair
func (k *Kraken) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(k.GetName(), p, assetType)
if err == nil {
if err != nil {
return k.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -58,7 +58,7 @@ func (l *LakeBTC) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.
// GetOrderbookEx returns orderbook base on the currency pair
func (l *LakeBTC) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(l.GetName(), p, assetType)
if err == nil {
if err != nil {
return l.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -77,7 +77,7 @@ func (l *Liqui) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Pr
// GetOrderbookEx returns orderbook base on the currency pair
func (l *Liqui) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(l.Name, p, assetType)
if err == nil {
if err != nil {
return l.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -45,7 +45,7 @@ func (l *LocalBitcoins) UpdateTicker(p pair.CurrencyPair, assetType string) (tic
// GetTickerPrice returns the ticker for a currency pair
func (l *LocalBitcoins) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error) {
tickerNew, err := ticker.GetTicker(l.GetName(), p, assetType)
if err == nil {
if err != nil {
return l.UpdateTicker(p, assetType)
}
return tickerNew, nil
@@ -54,7 +54,7 @@ func (l *LocalBitcoins) GetTickerPrice(p pair.CurrencyPair, assetType string) (t
// GetOrderbookEx returns orderbook base on the currency pair
func (l *LocalBitcoins) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(l.GetName(), p, assetType)
if err == nil {
if err != nil {
return l.UpdateOrderbook(p, assetType)
}
return ob, nil

View File

@@ -76,7 +76,7 @@ func (o *OKCoin) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.P
// GetOrderbookEx returns orderbook base on the currency pair
func (o *OKCoin) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(o.GetName(), currency, assetType)
if err == nil {
if err != nil {
return o.UpdateOrderbook(currency, assetType)
}
return ob, nil

View File

@@ -79,7 +79,7 @@ func (p *Poloniex) GetTickerPrice(currencyPair pair.CurrencyPair, assetType stri
// GetOrderbookEx returns orderbook base on the currency pair
func (p *Poloniex) GetOrderbookEx(currencyPair pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(p.GetName(), currencyPair, assetType)
if err == nil {
if err != nil {
return p.UpdateOrderbook(currencyPair, assetType)
}
return ob, nil

View File

@@ -64,7 +64,7 @@ func (w *WEX) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Pric
// GetOrderbookEx returns the orderbook for a currency pair
func (w *WEX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
ob, err := orderbook.GetOrderbook(w.GetName(), p, assetType)
if err == nil {
if err != nil {
return w.UpdateOrderbook(p, assetType)
}
return ob, nil