peer+server: provide more verbose logging

This commit is contained in:
yyforyongyu
2023-06-14 06:09:11 +08:00
parent 7f95810359
commit bacb49ddba
2 changed files with 3 additions and 2 deletions

View File

@@ -1099,7 +1099,7 @@ func (p *Brontide) readNextMessage() (lnwire.Message, error) {
pktLen, err := noiseConn.ReadNextHeader() pktLen, err := noiseConn.ReadNextHeader()
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("read next header: %w", err)
} }
// First we'll read the next _full_ message. We do this rather than // First we'll read the next _full_ message. We do this rather than
@@ -1128,7 +1128,7 @@ func (p *Brontide) readNextMessage() (lnwire.Message, error) {
// pool. // pool.
rawMsg, readErr := noiseConn.ReadNextBody(buf[:pktLen]) rawMsg, readErr := noiseConn.ReadNextBody(buf[:pktLen])
if readErr != nil { if readErr != nil {
return readErr return fmt.Errorf("read next body: %w", readErr)
} }
msgLen = uint64(len(rawMsg)) msgLen = uint64(len(rawMsg))

View File

@@ -4012,6 +4012,7 @@ func (s *server) peerTerminationWatcher(p *peer.Brontide, ready chan struct{}) {
// If the server is exiting then we can bail out early ourselves as all // If the server is exiting then we can bail out early ourselves as all
// the other sub-systems will already be shutting down. // the other sub-systems will already be shutting down.
if s.Stopped() { if s.Stopped() {
srvrLog.Debugf("Server quitting, exit early for peer %v", p)
return return
} }