fix: memory aliasing in loop

This commit is contained in:
Richard Ramos 2023-11-17 09:35:42 -04:00 committed by richΛrd
parent 573a97791e
commit 28160fe4f7
1 changed files with 2 additions and 1 deletions

View File

@ -168,7 +168,8 @@ func (f *FiltersManager) InitCommunityFilters(communityFiltersToInitialize []Com
// TODO: requests to join / cancels are currently being sent into the default waku topic. // TODO: requests to join / cancels are currently being sent into the default waku topic.
// They must be sent into an specific non protected shard // They must be sent into an specific non protected shard
for _, pubsubTopic := range topics { for _, pubsubTopic := range topics {
identityStr := PublicKeyToStr(&cf.PrivKey.PublicKey) pk := &cf.PrivKey.PublicKey
identityStr := PublicKeyToStr(pk)
rawFilter, err := f.addAsymmetric(identityStr, pubsubTopic, cf.PrivKey, true) rawFilter, err := f.addAsymmetric(identityStr, pubsubTopic, cf.PrivKey, true)
if err != nil { if err != nil {
f.logger.Debug("could not register community filter", zap.Error(err)) f.logger.Debug("could not register community filter", zap.Error(err))