bitfinexcom / bitfinex-api-go

BITFINEX Go trading API - Bitcoin, Litecoin, and Ether exchange
https://www.bitfinex.com/
MIT License
309 stars 220 forks source link

Heartbeat disconnect race condition fix #95

Closed brobits closed 6 years ago

brobits commented 6 years ago

When integrating the API, I noticed a race condition when intentionally resetting the client's connection. channel heartbeat changes did terminate and reset the connection, but the heartbeat terminate signal competed with other signals during close which failed to reset the connection. this change fixes this issue.

I've also made some small adjustments to the test websocket service to more consistently support expected disconnects during tests.