Skip to content

Commit 636d44e

Browse files
MozirDmitriyMarcoPolo
authored andcommitted
fix: handle error from mh.Sum in IDFromPublicKey
1 parent 2bed145 commit 636d44e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/peer/peer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ func IDFromPublicKey(pk ic.PubKey) (ID, error) {
169169
if AdvancedEnableInlining && len(b) <= maxInlineKeyLength {
170170
alg = mh.IDENTITY
171171
}
172-
hash, _ := mh.Sum(b, alg, -1)
172+
hash, err := mh.Sum(b, alg, -1)
173+
if err != nil {
174+
return "", err
175+
}
173176
return ID(hash), nil
174177
}
175178

0 commit comments

Comments
 (0)