Skip to content

Commit

Permalink
fix: (#50) concurrent map read and map write error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gandharv Sharma authored and Gandharv Sharma committed Mar 27, 2022
1 parent 5b623b2 commit 4634294
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/cancel_limit_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package engine

// CancelOrder remove the order from book and returns
func (ob *OrderBook) CancelOrder(id string) *Order {
ob.mutex.Lock()
orderNode := ob.orders[id]
ob.mutex.Unlock()

if orderNode == nil {
return nil
Expand Down

0 comments on commit 4634294

Please sign in to comment.