multi: enhance logging for debugging peer connection

This commit is contained in:
yyforyongyu committed 2021-12-23 15:14:37 +08:00
1 parent 5d9b59ac5a
commit 46050fc631
7 files changed
+42 -20

No files matched your search

+2 -1
View File
@@ -479,7 +479,8 @@ func (p *Brontide) Start() error {
return nil
}
peerLog.Tracef("Peer %v starting", p)
peerLog.Tracef("Peer %v starting with conn[%v->%v]", p,
p.cfg.Conn.LocalAddr(), p.cfg.Conn.RemoteAddr())
// Fetch and then load all the active channels we have with this remote
// peer from the database.
+8
View File
@@ -521,3 +521,11 @@ func (m *mockMessageConn) ReadNextHeader() (uint32, error) {
func (m *mockMessageConn) ReadNextBody(buf []byte) ([]byte, error) {
return m.curReadMessage, nil
}
func (m *mockMessageConn) RemoteAddr() net.Addr {
return nil
}
func (m *mockMessageConn) LocalAddr() net.Addr {
return nil
}