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

v1/orderbook: fix panic when sorting for checksum #145

Closed JacobPlaster closed 5 years ago

JacobPlaster commented 5 years ago

The checksum for the orderbook was sometimes throwing index out of range if the sides were not balances. This piece of code make sure the sort never operates out of bounds