mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
call matchingBooksMutex when assigning matching book
This commit is contained in:
parent
c70369084e
commit
4d7fe7f37d
|
@ -70,7 +70,9 @@ func (s *Stream) Connect(ctx context.Context) error {
|
||||||
matching.OnTradeUpdate(s.EmitTradeUpdate)
|
matching.OnTradeUpdate(s.EmitTradeUpdate)
|
||||||
matching.OnOrderUpdate(s.EmitOrderUpdate)
|
matching.OnOrderUpdate(s.EmitOrderUpdate)
|
||||||
matching.OnBalanceUpdate(s.EmitBalanceUpdate)
|
matching.OnBalanceUpdate(s.EmitBalanceUpdate)
|
||||||
|
s.exchange.matchingBooksMutex.Lock()
|
||||||
s.exchange.matchingBooks[symbol] = matching
|
s.exchange.matchingBooks[symbol] = matching
|
||||||
|
s.exchange.matchingBooksMutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// assign user data stream back
|
// assign user data stream back
|
||||||
|
|
Loading…
Reference in New Issue
Block a user