@@ -79,21 +79,21 @@ func (s *Server) initProtocol() {
7979
8080func (s * Server ) RollBackward (point common.Point , tip Tip ) error {
8181 s .Protocol .Logger ().
82- Debug (fmt .Sprintf ("server called %s RollBackward(point: %+v, tip: %+v)" , ProtocolName , point , tip ))
82+ Debug (fmt .Sprintf ("%s: server %+v called RollBackward(point: {Slot: %d, Hash: %x}, tip: {Point: %+v, BlockNumber: %d} )" , ProtocolName , s . callbackContext . ConnectionId . RemoteAddr , point . Slot , point . Hash , tip . Point , tip . BlockNumber ))
8383 msg := NewMsgRollBackward (point , tip )
8484 return s .SendMessage (msg )
8585}
8686
8787func (s * Server ) AwaitReply () error {
8888 s .Protocol .Logger ().
89- Debug (fmt .Sprintf ("server called %s AwaitReply()" , ProtocolName ))
89+ Debug (fmt .Sprintf ("%s: server %+v called AwaitReply()" , ProtocolName , s . callbackContext . ConnectionId . RemoteAddr ))
9090 msg := NewMsgAwaitReply ()
9191 return s .SendMessage (msg )
9292}
9393
9494func (s * Server ) RollForward (blockType uint , blockData []byte , tip Tip ) error {
9595 s .Protocol .Logger ().
96- Debug (fmt .Sprintf ("server called %s Rollforward (blockType: %+v, blockData: %x, tip: %+v )" , ProtocolName , blockType , blockData , tip ))
96+ Debug (fmt .Sprintf ("%s: server %+v called RollForward (blockType: %+v, blockData: %x, tip: {Point: {Slot: %d, Hash: %x}, BlockNumber: %d} )" , ProtocolName , s . callbackContext . ConnectionId . RemoteAddr , blockType , blockData , tip . Point . Slot , tip . Point . Hash , tip . BlockNumber ))
9797 if s .Mode () == protocol .ProtocolModeNodeToNode {
9898 eraId := ledger .BlockToBlockHeaderTypeMap [blockType ]
9999 msg := NewMsgRollForwardNtN (
@@ -114,8 +114,6 @@ func (s *Server) RollForward(blockType uint, blockData []byte, tip Tip) error {
114114}
115115
116116func (s * Server ) messageHandler (msg protocol.Message ) error {
117- s .Protocol .Logger ().
118- Debug (fmt .Sprintf ("handling server message for %s" , ProtocolName ))
119117 var err error
120118 switch msg .Type () {
121119 case MessageTypeRequestNext :
@@ -137,8 +135,8 @@ func (s *Server) messageHandler(msg protocol.Message) error {
137135func (s * Server ) handleRequestNext () error {
138136 // TODO: figure out why this one log message causes a panic (and only this one)
139137 // during tests
140- // s.Protocol.Logger().
141- // Debug(fmt.Sprintf("handling server request next for %s ", ProtocolName))
138+ //s.Protocol.Logger().
139+ // Debug(fmt.Sprintf("%s: server request next for %+v ", ProtocolName, s.callbackContext.ConnectionId.RemoteAddr ))
142140 if s .config == nil || s .config .RequestNextFunc == nil {
143141 return fmt .Errorf (
144142 "received chain-sync RequestNext message but no callback function is defined" ,
@@ -149,7 +147,7 @@ func (s *Server) handleRequestNext() error {
149147
150148func (s * Server ) handleFindIntersect (msg protocol.Message ) error {
151149 s .Protocol .Logger ().
152- Debug (fmt .Sprintf ("handling server find intersect for %s " , ProtocolName ))
150+ Debug (fmt .Sprintf ("%s: server find intersect for %+v " , ProtocolName , s . callbackContext . ConnectionId . RemoteAddr ))
153151 if s .config == nil || s .config .FindIntersectFunc == nil {
154152 return fmt .Errorf (
155153 "received chain-sync FindIntersect message but no callback function is defined" ,
@@ -179,7 +177,7 @@ func (s *Server) handleFindIntersect(msg protocol.Message) error {
179177
180178func (s * Server ) handleDone () error {
181179 s .Protocol .Logger ().
182- Debug (fmt .Sprintf ("handling server done for %s " , ProtocolName ))
180+ Debug (fmt .Sprintf ("%s: server done for %+v " , ProtocolName , s . callbackContext . ConnectionId . RemoteAddr ))
183181 // Restart protocol
184182 s .Protocol .Stop ()
185183 s .initProtocol ()
0 commit comments