Bitfinex: Fix websocket trade processing (#1754)

* Bitfinex: Fix WS trade processing

* Add handling for funding trades

Fixes #1746

* Linter: Disable shadow linting for err

It's been a year, and I'm still getting caught out by govet demanding I
don't shadow a var I was deliberately shadowing.
Made worse by an increase in clashes with stylecheck when they both want
opposite things on the same line.

* Bitfinex: Move websocket constants to websocket file

* Bitfinex: Rename channel consts

* Bitfinex: Send individual WS trades down the DataHandler
This commit is contained in:
Gareth Kirwan
2025-02-17 02:20:14 +00:00
committed by GitHub
parent 8fad985669
commit 5463e359bc
6 changed files with 228 additions and 269 deletions

View File

@@ -242,9 +242,7 @@ func (m *WebsocketRoutineManager) websocketDataHandler(exchName string, data int
}
m.syncer.PrintTickerSummary(&d[x], "websocket", err)
}
case order.Detail,
ticker.Price,
orderbook.Depth:
case order.Detail, ticker.Price, orderbook.Depth:
return errUseAPointer
case stream.KlineData:
if m.verbose {
@@ -347,7 +345,7 @@ func (m *WebsocketRoutineManager) websocketDataHandler(exchName string, data int
m.printAccountHoldingsChangeSummary(d[x])
}
}
case []trade.Data:
case []trade.Data, trade.Data:
if m.verbose {
log.Infof(log.Trade, "%+v", d)
}