Skip to content

Commit 1167e9b

Browse files
committed
server: fix logging of pubkey
1 parent c5973aa commit 1167e9b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

server.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4113,11 +4113,12 @@ func (s *server) peerInitializer(p *peer.Brontide) {
41134113
s.wg.Add(1)
41144114
go s.peerTerminationWatcher(p, ready)
41154115

4116+
pubBytes := p.IdentityKey().SerializeCompressed()
4117+
41164118
// Start the peer! If an error occurs, we Disconnect the peer, which
41174119
// will unblock the peerTerminationWatcher.
41184120
if err := p.Start(); err != nil {
4119-
srvrLog.Warnf("Starting peer=%v got error: %v",
4120-
p.IdentityKey(), err)
4121+
srvrLog.Warnf("Starting peer=%x got error: %v", pubBytes, err)
41214122

41224123
p.Disconnect(fmt.Errorf("unable to start peer: %w", err))
41234124
return
@@ -4127,13 +4128,15 @@ func (s *server) peerInitializer(p *peer.Brontide) {
41274128
// was successful, and to begin watching the peer's wait group.
41284129
close(ready)
41294130

4130-
pubStr := string(p.IdentityKey().SerializeCompressed())
4131-
41324131
s.mu.Lock()
41334132
defer s.mu.Unlock()
41344133

41354134
// Check if there are listeners waiting for this peer to come online.
41364135
srvrLog.Debugf("Notifying that peer %v is online", p)
4136+
4137+
// TODO(guggero): Do a proper conversion to a string everywhere, or use
4138+
// route.Vertex as the key type of peerConnectedListeners.
4139+
pubStr := string(pubBytes)
41374140
for _, peerChan := range s.peerConnectedListeners[pubStr] {
41384141
select {
41394142
case peerChan <- p:

0 commit comments

Comments
 (0)