Skip to content

Commit

Permalink
chore(service/header): remove logs that will be anyway duplicated dur…
Browse files Browse the repository at this point in the history
…ing validation and document error handling
  • Loading branch information
Wondertan committed Feb 8, 2022
1 parent c660c11 commit ce3a7ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions service/header/p2p_subscriber.go
Expand Up @@ -91,7 +91,8 @@ func msgID(pmsg *pb.Message) string {

h, err := UnmarshalExtendedHeader(pmsg.Data)
if err != nil {
log.Errorw("unmarshalling header while computing msg id", "err", err)
// There is nothing we can do about the error, and it will be anyway caught during validation.
// We also *have* to return some ID for the msg, so give the hash of even faulty msg
return msgID(pmsg.Data)
}

Expand All @@ -108,7 +109,7 @@ func msgID(pmsg *pb.Message) string {

data, err := MarshalExtendedHeader(h)
if err != nil {
log.Errorw("marshaling header while computing msg id", "err", err)
// See the note under unmarshalling step
return msgID(pmsg.Data)
}

Expand Down

0 comments on commit ce3a7ea

Please sign in to comment.