@@ -148,7 +148,7 @@ func (h *Network) GetBlockHeader(blockHash []byte) (*types.Header, error) {
148148 }
149149 err = h .portalProtocol .Put (contentKey , contentId , content )
150150 if err != nil {
151- h .log .Error ("failed to store content in getBlockHeader" , "contentKey" , hexutil .Encode (contentKey ), "content " , hexutil . Encode ( content ) )
151+ h .log .Error ("failed to store content in getBlockHeader" , "contentKey" , hexutil .Encode (contentKey ), "err " , err )
152152 }
153153 return header , nil
154154 }
@@ -199,7 +199,7 @@ func (h *Network) GetBlockBody(blockHash []byte) (*types.Body, error) {
199199 }
200200 err = h .portalProtocol .Put (contentKey , contentId , content )
201201 if err != nil {
202- h .log .Error ("failed to store content in getBlockBody" , "contentKey" , hexutil .Encode (contentKey ), "content " , hexutil . Encode ( content ) )
202+ h .log .Error ("failed to store content in getBlockBody" , "contentKey" , hexutil .Encode (contentKey ), "err " , err )
203203 }
204204 return body , nil
205205 }
@@ -248,7 +248,7 @@ func (h *Network) GetReceipts(blockHash []byte) ([]*types.Receipt, error) {
248248 }
249249 err = h .portalProtocol .Put (contentKey , contentId , content )
250250 if err != nil {
251- h .log .Error ("failed to store content in getReceipts" , "contentKey" , hexutil .Encode (contentKey ), "content " , hexutil . Encode ( content ) )
251+ h .log .Error ("failed to store content in getReceipts" , "contentKey" , hexutil .Encode (contentKey ), "err " , err )
252252 }
253253 return receipts , nil
254254 }
@@ -564,8 +564,7 @@ func (h *Network) validateContents(contentKeys [][]byte, contents [][]byte) erro
564564 contentKey := contentKeys [i ]
565565 err := h .validateContent (contentKey , content )
566566 if err != nil {
567- h .log .Error ("content validate failed" , "contentKey" , hexutil .Encode (contentKey ), "content" , hexutil .Encode (content ), "err" , err )
568- return fmt .Errorf ("content validate failed with content key %x and content %x" , contentKey , content )
567+ return fmt .Errorf ("content validate failed with content key %x and content %x, err is %v" , contentKey , content , err )
569568 }
570569 contentId := h .portalProtocol .ToContentId (contentKey )
571570 _ = h .portalProtocol .Put (contentKey , contentId , content )
0 commit comments