From ee6f140b7e98fde70969a6cd9969ef59758d72d6 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 10 Mar 2024 09:17:13 -0400 Subject: [PATCH] fix: add logging of peer ip and the node id signing the message if handshake is not done --- protocol/signed_message.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/signed_message.go b/protocol/signed_message.go index 2bf6402..7e03aad 100644 --- a/protocol/signed_message.go +++ b/protocol/signed_message.go @@ -94,7 +94,11 @@ func (s *SignedMessage) HandleMessage(message IncomingMessageData) error { if msgHandler, valid := GetSignedMessageType(payload.kind); valid { logger.Debug("SignedMessage", zap.Any("type", types.ProtocolMethodMap[types.ProtocolMethod(payload.kind)])) if msgHandler.RequiresHandshake() && !peer.IsHandshakeDone() { - logger.Debug("Peer is not handshake done, ignoring message", zap.Any("type", types.ProtocolMethodMap[types.ProtocolMethod(payload.kind)])) + nid, err := s.nodeId.ToString() + if err != nil { + return err + } + logger.Debug("Peer is not handshake done, ignoring message", zap.Any("type", types.ProtocolMethodMap[types.ProtocolMethod(payload.kind)]), zap.String("peerIP", peer.GetIPString()), zap.String("nodeId", nid)) return nil }