@@ -79,21 +79,21 @@ func (s *Server) initProtocol() {
79
79
80
80
func (s * Server ) RollBackward (point common.Point , tip Tip ) error {
81
81
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 ))
83
83
msg := NewMsgRollBackward (point , tip )
84
84
return s .SendMessage (msg )
85
85
}
86
86
87
87
func (s * Server ) AwaitReply () error {
88
88
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 ))
90
90
msg := NewMsgAwaitReply ()
91
91
return s .SendMessage (msg )
92
92
}
93
93
94
94
func (s * Server ) RollForward (blockType uint , blockData []byte , tip Tip ) error {
95
95
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 ))
97
97
if s .Mode () == protocol .ProtocolModeNodeToNode {
98
98
eraId := ledger .BlockToBlockHeaderTypeMap [blockType ]
99
99
msg := NewMsgRollForwardNtN (
@@ -114,8 +114,6 @@ func (s *Server) RollForward(blockType uint, blockData []byte, tip Tip) error {
114
114
}
115
115
116
116
func (s * Server ) messageHandler (msg protocol.Message ) error {
117
- s .Protocol .Logger ().
118
- Debug (fmt .Sprintf ("handling server message for %s" , ProtocolName ))
119
117
var err error
120
118
switch msg .Type () {
121
119
case MessageTypeRequestNext :
@@ -137,8 +135,8 @@ func (s *Server) messageHandler(msg protocol.Message) error {
137
135
func (s * Server ) handleRequestNext () error {
138
136
// TODO: figure out why this one log message causes a panic (and only this one)
139
137
// 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 ))
142
140
if s .config == nil || s .config .RequestNextFunc == nil {
143
141
return fmt .Errorf (
144
142
"received chain-sync RequestNext message but no callback function is defined" ,
@@ -149,7 +147,7 @@ func (s *Server) handleRequestNext() error {
149
147
150
148
func (s * Server ) handleFindIntersect (msg protocol.Message ) error {
151
149
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 ))
153
151
if s .config == nil || s .config .FindIntersectFunc == nil {
154
152
return fmt .Errorf (
155
153
"received chain-sync FindIntersect message but no callback function is defined" ,
@@ -179,7 +177,7 @@ func (s *Server) handleFindIntersect(msg protocol.Message) error {
179
177
180
178
func (s * Server ) handleDone () error {
181
179
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 ))
183
181
// Restart protocol
184
182
s .Protocol .Stop ()
185
183
s .initProtocol ()
0 commit comments