Skip to content

Commit

Permalink
optimize txs
Browse files Browse the repository at this point in the history
  • Loading branch information
grkamil committed Oct 20, 2020
1 parent 84c4083 commit c27cb80
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions transaction/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ func (s Service) transformCheckDataToModel(raw string) (*dataModels.CheckData, e
return nil, err
}

gasCoin, err := s.coinRepository.FindByID(uint(data.GasCoin))
if err != nil {
return nil, err
gasCoin := coin
if data.Coin != data.GasCoin {
gasCoin, err = s.coinRepository.FindByID(uint(data.GasCoin))
if err != nil {
return nil, err
}
}

return &dataModels.CheckData{
Expand Down

0 comments on commit c27cb80

Please sign in to comment.