Skip to content

Commit

Permalink
buck review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <[email protected]>
  • Loading branch information
ukane-philemon committed Sep 22, 2024
1 parent b4d82d0 commit a491ae9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions exchanges/exchanges.go
Original file line number Diff line number Diff line change
Expand Up @@ -2859,12 +2859,11 @@ func (dcr *DecredDEX) setOrderBook(ob *msgjson.OrderBook) {
depth := dcr.wsDepthSnapshot()

if dcr.lastRate == 0 {
// Use mid gap as a sane default if the orderbook is not empty.
midGap := depth.MidGap()
if midGap == 1 {
return // don't send rate update if we don't have a valid rate.
if len(ob.Orders) == 0 {
return // don't send rate update if we don't have a valid rate and there are no orders to get a sane midGap.
}
dcr.lastRate = midGap
// Use mid gap as a sane default if the orderbook is not empty.
dcr.lastRate = depth.MidGap()
}

dcr.Update(&ExchangeState{
Expand Down

0 comments on commit a491ae9

Please sign in to comment.