Skip to content

Commit b2d41ee

Browse files
committed
server: fix logging of pubkey
1 parent 2ef42c6 commit b2d41ee

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
@@ -4020,11 +4020,12 @@ func (s *server) peerInitializer(p *peer.Brontide) {
40204020
s.wg.Add(1)
40214021
go s.peerTerminationWatcher(p, ready)
40224022

4023+
pubBytes := p.IdentityKey().SerializeCompressed()
4024+
40234025
// Start the peer! If an error occurs, we Disconnect the peer, which
40244026
// will unblock the peerTerminationWatcher.
40254027
if err := p.Start(); err != nil {
4026-
srvrLog.Warnf("Starting peer=%v got error: %v",
4027-
p.IdentityKey(), err)
4028+
srvrLog.Warnf("Starting peer=%x got error: %v", pubBytes, err)
40284029

40294030
p.Disconnect(fmt.Errorf("unable to start peer: %w", err))
40304031
return
@@ -4034,13 +4035,15 @@ func (s *server) peerInitializer(p *peer.Brontide) {
40344035
// was successful, and to begin watching the peer's wait group.
40354036
close(ready)
40364037

4037-
pubStr := string(p.IdentityKey().SerializeCompressed())
4038-
40394038
s.mu.Lock()
40404039
defer s.mu.Unlock()
40414040

40424041
// Check if there are listeners waiting for this peer to come online.
40434042
srvrLog.Debugf("Notifying that peer %v is online", p)
4043+
4044+
// TODO(guggero): Do a proper conversion to a string everywhere, or use
4045+
// route.Vertex as the key type of peerConnectedListeners.
4046+
pubStr := string(pubBytes)
40444047
for _, peerChan := range s.peerConnectedListeners[pubStr] {
40454048
select {
40464049
case peerChan <- p:

0 commit comments

Comments
 (0)