Skip to content

Commit

Permalink
CR: fix identityOpts reuse concern
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Jun 21, 2024
1 parent 5e327fa commit 3c14a74
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions network/hybridNetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ func NewHybridP2PNetwork(log logging.Logger, cfg config.Local, datadir string, p
// supply alternate NetAddress for P2P network
p2pcfg := cfg
p2pcfg.NetAddress = cfg.P2PListenAddress
identityOpts := identityOpts{
tracker: NewIdentityTracker(),
}
p2pnet, err := NewP2PNetwork(log, p2pcfg, datadir, phonebookAddresses, genesisID, networkID, nodeInfo, &identityOpts)
identityTracker := NewIdentityTracker()
p2pnet, err := NewP2PNetwork(log, p2pcfg, datadir, phonebookAddresses, genesisID, networkID, nodeInfo, &identityOpts{tracker: identityTracker})
if err != nil {
return nil, err
}
identityOpts.scheme = NewIdentityChallengeScheme(NetIdentityDedupNames(cfg.PublicAddress, p2pnet.PeerID().String()), NetIdentitySigner(p2pnet.PeerIDSigner()))

identityOpts := identityOpts{

Check failure on line 51 in network/hybridNetwork.go

View workflow job for this annotation

GitHub Actions / reviewdog-errors

[Lint Errors] reported by reviewdog 🐶 shadow: declaration of "identityOpts" shadows declaration at line 104 (govet) Raw Output: network/hybridNetwork.go:51:2: shadow: declaration of "identityOpts" shadows declaration at line 104 (govet) identityOpts := identityOpts{ ^
tracker: identityTracker,
scheme: NewIdentityChallengeScheme(NetIdentityDedupNames(cfg.PublicAddress, p2pnet.PeerID().String()), NetIdentitySigner(p2pnet.PeerIDSigner())),
}
wsnet, err := NewWebsocketNetwork(log, cfg, phonebookAddresses, genesisID, networkID, nodeInfo, &identityOpts)
if err != nil {
return nil, err
Expand Down

0 comments on commit 3c14a74

Please sign in to comment.