Skip to content

Commit

Permalink
fix filterTick fatal error: concurrent map iteration and map write
Browse files Browse the repository at this point in the history
  • Loading branch information
nghiatomo committed Jun 23, 2020
1 parent 031db91 commit 83f071b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/ohlcv.go
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,8 @@ func (s *OHLCVService) getTokenPairData(pairName string, baseTokenSymbol string,

// GetTokenPairData get tick of pair tokens
func (s *OHLCVService) GetTokenPairData(baseToken common.Address, quoteToken common.Address) *types.PairData {
s.mutex.RLock()
defer s.mutex.RUnlock()
p, err := s.pairDao.GetByTokenAddress(baseToken, quoteToken)
if err != nil {
return nil
Expand Down

0 comments on commit 83f071b

Please sign in to comment.