Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 24d7f19

Browse files
vyzoaarshkshah1992
authored andcommitted
set the remote peer id in insecure transport when initialized without keys
1 parent 22c8a75 commit 24d7f19

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sec/insecure/insecure.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ func (t *Transport) SecureOutbound(ctx context.Context, insecure net.Conn, p pee
108108
p, conn.remote)
109109
}
110110

111+
if t.key == nil && conn.remote == "" {
112+
// set the remote peer id if we were initialiazed without keys
113+
conn.remote = p
114+
}
115+
111116
return conn, nil
112117
}
113118

0 commit comments

Comments
 (0)