mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
server: fix logging of pubkey
This commit is contained in:
parent
c5973aa136
commit
1167e9b6dd
1 changed files with 7 additions and 4 deletions
11
server.go
11
server.go
|
@ -4113,11 +4113,12 @@ func (s *server) peerInitializer(p *peer.Brontide) {
|
||||||
s.wg.Add(1)
|
s.wg.Add(1)
|
||||||
go s.peerTerminationWatcher(p, ready)
|
go s.peerTerminationWatcher(p, ready)
|
||||||
|
|
||||||
|
pubBytes := p.IdentityKey().SerializeCompressed()
|
||||||
|
|
||||||
// Start the peer! If an error occurs, we Disconnect the peer, which
|
// Start the peer! If an error occurs, we Disconnect the peer, which
|
||||||
// will unblock the peerTerminationWatcher.
|
// will unblock the peerTerminationWatcher.
|
||||||
if err := p.Start(); err != nil {
|
if err := p.Start(); err != nil {
|
||||||
srvrLog.Warnf("Starting peer=%v got error: %v",
|
srvrLog.Warnf("Starting peer=%x got error: %v", pubBytes, err)
|
||||||
p.IdentityKey(), err)
|
|
||||||
|
|
||||||
p.Disconnect(fmt.Errorf("unable to start peer: %w", err))
|
p.Disconnect(fmt.Errorf("unable to start peer: %w", err))
|
||||||
return
|
return
|
||||||
|
@ -4127,13 +4128,15 @@ func (s *server) peerInitializer(p *peer.Brontide) {
|
||||||
// was successful, and to begin watching the peer's wait group.
|
// was successful, and to begin watching the peer's wait group.
|
||||||
close(ready)
|
close(ready)
|
||||||
|
|
||||||
pubStr := string(p.IdentityKey().SerializeCompressed())
|
|
||||||
|
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
|
||||||
// Check if there are listeners waiting for this peer to come online.
|
// Check if there are listeners waiting for this peer to come online.
|
||||||
srvrLog.Debugf("Notifying that peer %v is online", p)
|
srvrLog.Debugf("Notifying that peer %v is online", p)
|
||||||
|
|
||||||
|
// TODO(guggero): Do a proper conversion to a string everywhere, or use
|
||||||
|
// route.Vertex as the key type of peerConnectedListeners.
|
||||||
|
pubStr := string(pubBytes)
|
||||||
for _, peerChan := range s.peerConnectedListeners[pubStr] {
|
for _, peerChan := range s.peerConnectedListeners[pubStr] {
|
||||||
select {
|
select {
|
||||||
case peerChan <- p:
|
case peerChan <- p:
|
||||||
|
|
Loading…
Add table
Reference in a new issue