@@ -187,7 +187,7 @@ func (this *BlockSyncMgr) checkTimeout() {
187187 }
188188 flightInfo .ResetStartTime ()
189189 flightInfo .MarkFailedNode ()
190- log .Infof ("BlockSyncMgr checkTimeout sync headers:%d timeout after:%d s Times:%d" , height , SYNC_HEADER_REQUEST_TIMEOUT , flightInfo .GetTotalFailedTimes ())
190+ log .Infof ("checkTimeout sync headers:%d timeout after:%d s Times:%d" , height , SYNC_HEADER_REQUEST_TIMEOUT , flightInfo .GetTotalFailedTimes ())
191191 reqNode := this .getNodeWithMinFailedTimes (flightInfo , curBlockHeight )
192192 if reqNode == nil {
193193 break
@@ -197,7 +197,7 @@ func (this *BlockSyncMgr) checkTimeout() {
197197 headerHash := this .ledger .GetCurrentHeaderHash ()
198198 buf , err := msgpack .NewHeadersReq (headerHash )
199199 if err != nil {
200- log .Error ("failed build a new headersReq" )
200+ log .Error ("checkTimeout failed build a new headersReq" )
201201 } else {
202202 this .server .Send (reqNode , buf , false )
203203 }
@@ -209,7 +209,7 @@ func (this *BlockSyncMgr) checkTimeout() {
209209 }
210210 flightInfo .ResetStartTime ()
211211 flightInfo .MarkFailedNode ()
212- log .Infof ("BlockSyncMgr checkTimeout sync height:%d block:%x timeout after:%d s times:%d" , flightInfo .Height , blockHash , SYNC_BLOCK_REQUEST_TIMEOUT , flightInfo .GetTotalFailedTimes ())
212+ log .Infof ("checkTimeout sync height:%d block:0x %x timeout after:%d s times:%d" , flightInfo .Height , blockHash , SYNC_BLOCK_REQUEST_TIMEOUT , flightInfo .GetTotalFailedTimes ())
213213 reqNode := this .getNodeWithMinFailedTimes (flightInfo , curBlockHeight )
214214 if reqNode == nil {
215215 break
@@ -218,12 +218,12 @@ func (this *BlockSyncMgr) checkTimeout() {
218218
219219 reqBuf , err := msgpack .NewBlkDataReq (blockHash )
220220 if err != nil {
221- log .Error ("syncBlock error:" , err )
221+ log .Error ("checkTimeout NewBlkDataReq error:" , err )
222222 }
223223 err = this .server .Send (reqNode , reqBuf , false )
224224
225225 if err != nil {
226- log .Errorf ("BlockSyncMgr checkTimeout Height:%d Hash: %x ReqBlkData error:%s" , flightInfo . Height , blockHash , err )
226+ log .Errorf ("checkTimeout reqNode ID:0x %x Send error:%s" , reqNode . GetID () , err )
227227 continue
228228 }
229229 }
@@ -263,12 +263,12 @@ func (this *BlockSyncMgr) syncHeader() {
263263 headerHash := this .ledger .GetCurrentHeaderHash ()
264264 buf , err := msgpack .NewHeadersReq (headerHash )
265265 if err != nil {
266- log .Error ("failed build a new headersReq" )
266+ log .Error ("syncHeader failed build a new headersReq" )
267267 } else {
268268 this .server .Send (reqNode , buf , false )
269269 }
270270
271- log .Infof ("SendMsgSyncHeaders Request Height:%d" , NextHeaderId )
271+ log .Infof ("syncHeader request Height:%d" , NextHeaderId )
272272}
273273
274274func (this * BlockSyncMgr ) syncBlock () {
@@ -324,7 +324,7 @@ func (this *BlockSyncMgr) syncBlock() {
324324 }
325325 err = this .server .Send (reqNode , reqBuf , false )
326326 if err != nil {
327- log .Errorf ("BlockSyncMgr syncBlock Height:%d ReqBlkData error:%s" , nextBlockHeight , err )
327+ log .Errorf ("syncBlock Height:%d ReqBlkData error:%s" , nextBlockHeight , err )
328328 return
329329 }
330330 counter ++
@@ -350,7 +350,7 @@ func (this *BlockSyncMgr) OnHeaderReceive(headers []*types.Header) {
350350 err := this .ledger .AddHeaders (headers )
351351 this .delFlightHeader (height )
352352 if err != nil {
353- log .Errorf ("BlockSyncMgr AddHeaders error:%s" , err )
353+ log .Errorf ("OnHeaderReceive AddHeaders error:%s" , err )
354354 return
355355 }
356356 this .syncHeader ()
@@ -379,7 +379,7 @@ func (this *BlockSyncMgr) OnBlockReceive(block *types.Block) {
379379
380380//OnAddNode to node list when a new node added
381381func (this * BlockSyncMgr ) OnAddNode (nodeId uint64 ) {
382- log .Infof ("BlockSyncMgr OnAddNode:%d" , nodeId )
382+ log .Infof ("OnAddNode:%d" , nodeId )
383383 this .lock .Lock ()
384384 defer this .lock .Unlock ()
385385 this .nodeList = append (this .nodeList , nodeId )
@@ -400,7 +400,7 @@ func (this *BlockSyncMgr) OnDelNode(nodeId uint64) {
400400 return
401401 }
402402 this .nodeList = append (this .nodeList [:index ], this .nodeList [index + 1 :]... )
403- log .Infof ("BlockSyncMgr OnDelNode:%d" , nodeId )
403+ log .Infof ("OnDelNode:%d" , nodeId )
404404}
405405
406406func (this * BlockSyncMgr ) tryGetSyncHeaderLock () bool {
@@ -496,7 +496,7 @@ func (this *BlockSyncMgr) saveBlock() {
496496 err := this .ledger .AddBlock (nextBlock )
497497 this .delBlockCache (nextBlockHeight )
498498 if err != nil {
499- log .Warnf ("BlockSyncMgr saveBlock Height:%d AddBlock error:%s" , nextBlockHeight , err )
499+ log .Warnf ("saveBlock Height:%d AddBlock error:%s" , nextBlockHeight , err )
500500 reqNode := this .getNextNode (nextBlockHeight )
501501 if reqNode == nil {
502502 return
@@ -509,7 +509,7 @@ func (this *BlockSyncMgr) saveBlock() {
509509 }
510510 err = this .server .Send (reqNode , reqBuf , false )
511511 if err != nil {
512- log .Errorf ("BlockSyncMgr saveBlock Height:%d ReqBlkData error:%s" , nextBlockHeight , err )
512+ log .Errorf ("saveBlock Height:%d ReqBlkData error:%s" , nextBlockHeight , err )
513513 }
514514 return
515515 }
0 commit comments