diff --git a/session/pingpong/hermes_channel_repository.go b/session/pingpong/hermes_channel_repository.go index 60c84f3b35..0d58dfbba9 100644 --- a/session/pingpong/hermes_channel_repository.go +++ b/session/pingpong/hermes_channel_repository.go @@ -454,25 +454,20 @@ func (hcr *HermesChannelRepository) updateChannelWithLatestPromise(chainID int64 func (hcr *HermesChannelRepository) updateChannel(chainID int64, new HermesChannel) { earningsOld := hcr.sumChannelsDetailed(chainID, new.Identity) - { - hcr.lock.Lock() - defer hcr.lock.Unlock() - - updated := false - - v := hcr.channels[chainID] - for i, channel := range v { - if channel.Identity == new.Identity && channel.HermesID == new.HermesID { - updated = true - hcr.channels[chainID][i] = new - break - } - } - res := append(hcr.channels[chainID], new) - if !updated { - hcr.channels[chainID] = res + updated := false + + v := hcr.channels[chainID] + for i, channel := range v { + if channel.Identity == new.Identity && channel.HermesID == new.HermesID { + updated = true + hcr.channels[chainID][i] = new + break } } + res := append(hcr.channels[chainID], new) + if !updated { + hcr.channels[chainID] = res + } log.Info().Msgf( "Loaded state for provider %q, hermesID %q: balance %v, available balance %v, unsettled balance %v",