Skip to content

Commit 3807bd3

Browse files
committed
fix: lookup correct peer id in transport controller
Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent 6c24c52 commit 3807bd3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

transport/controller/controller.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,11 @@ func (c *Controller) GetPeerLinks(peerID peer.ID) []link.Link {
145145
// Returning nil ends execution.
146146
// Returning an error triggers a retry with backoff.
147147
func (c *Controller) Execute(ctx context.Context) error {
148-
// lookup the peer id u
149-
localPeerID := c.peerID
150-
151148
// Acquire a handle to the node.
152149
c.le.
153-
WithField("peer-id", localPeerID.String()).
150+
WithField("peer-id", c.lookupPeerID.String()).
154151
Debug("waiting for peer private key")
155-
localPeer, _, localPeerRef, err := peer.GetPeerWithID(ctx, c.bus, localPeerID, false, nil)
152+
localPeer, _, localPeerRef, err := peer.GetPeerWithID(ctx, c.bus, c.lookupPeerID, false, nil)
156153
if err != nil {
157154
return err
158155
}
@@ -164,7 +161,7 @@ func (c *Controller) Execute(ctx context.Context) error {
164161
return err
165162
}
166163

167-
localPeerID, err = peer.IDFromPrivateKey(privKey)
164+
localPeerID, err := peer.IDFromPrivateKey(privKey)
168165
if err != nil {
169166
return err
170167
}

0 commit comments

Comments
 (0)