@@ -250,14 +250,14 @@ func (s *WeshOrbitDB) openAccountGroup(ctx context.Context, options *orbitdb.Cre
250
250
}
251
251
252
252
func (s * WeshOrbitDB ) setHeadsForGroup (ctx context.Context , g * protocoltypes.Group , metaHeads , messageHeads []cid.Cid ) error {
253
- id := g .GroupIDAsString ()
253
+ groupID := g .GroupIDAsString ()
254
254
255
255
var (
256
256
err error
257
257
metaImpl , messagesImpl orbitdb.Store
258
258
)
259
259
260
- existingGC , err := s .getGroupContext (id )
260
+ existingGC , err := s .getGroupContext (groupID )
261
261
if err != nil && ! errcode .Is (err , errcode .ErrMissingMapKey ) {
262
262
return errcode .ErrInternal .Wrap (err )
263
263
}
@@ -266,7 +266,6 @@ func (s *WeshOrbitDB) setHeadsForGroup(ctx context.Context, g *protocoltypes.Gro
266
266
messagesImpl = existingGC .messageStore
267
267
}
268
268
if metaImpl == nil || messagesImpl == nil {
269
- groupID := g .GroupIDAsString ()
270
269
s .groups .Store (groupID , g )
271
270
272
271
if err := s .registerGroupSigningPubKey (g ); err != nil {
@@ -380,17 +379,16 @@ func (s *WeshOrbitDB) OpenGroup(ctx context.Context, g *protocoltypes.Group, opt
380
379
return nil , errcode .ErrInvalidInput .Wrap (fmt .Errorf ("db open in naive mode" ))
381
380
}
382
381
383
- id := g .GroupIDAsString ()
382
+ groupID := g .GroupIDAsString ()
384
383
385
- existingGC , err := s .getGroupContext (id )
384
+ existingGC , err := s .getGroupContext (groupID )
386
385
if err != nil && ! errcode .Is (err , errcode .ErrMissingMapKey ) {
387
386
return nil , errcode .ErrInternal .Wrap (err )
388
387
}
389
388
if err == nil {
390
389
return existingGC , nil
391
390
}
392
391
393
- groupID := g .GroupIDAsString ()
394
392
s .groups .Store (groupID , g )
395
393
396
394
if err := s .registerGroupPrivateKey (g ); err != nil {
0 commit comments