mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-07 04:23:52 +00:00
chore: log when validate content failed
This commit is contained in:
parent
3ef0db3662
commit
c9d6817008
1 changed files with 3 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
|
|
@ -553,7 +554,8 @@ func (h *HistoryNetwork) validateContents(contentKeys [][]byte, contents [][]byt
|
|||
contentKey := contentKeys[i]
|
||||
err := h.validateContent(contentKey, content)
|
||||
if err != nil {
|
||||
return fmt.Errorf("content validate failed with content key %v", contentKey)
|
||||
h.log.Error("content validate failed", "contentKey", hexutil.Encode(contentKey), "content", hexutil.Encode(content), "err", err)
|
||||
return fmt.Errorf("content validate failed with content key %v", hexutil.Encode(contentKey))
|
||||
}
|
||||
contentId := h.portalProtocol.ToContentId(contentKey)
|
||||
_ = h.portalProtocol.Put(contentId, content)
|
||||
|
|
|
|||
Loading…
Reference in a new issue