Merge pull request #1136 from libp2p/fix/deprecated

fix: remove deprecated call
This commit is contained in:
Steven Allen 2021-07-22 15:43:40 -07:00 committed by GitHub
commit d38694b8cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import (
"sync"
"time"
ic "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
@ -529,7 +529,7 @@ func (ids *IDService) createBaseIdentifyResponse(
// if neither of the key is present it is safe to assume that we are using an insecure transport.
} else {
// public key is present. Safe to proceed.
if kb, err := ownKey.Bytes(); err != nil {
if kb, err := crypto.MarshalPublicKey(ownKey); err != nil {
log.Errorf("failed to convert key to bytes")
} else {
mes.PublicKey = kb
@ -650,7 +650,7 @@ func (ids *IDService) consumeReceivedPubKey(c network.Conn, kb []byte) {
return
}
newKey, err := ic.UnmarshalPublicKey(kb)
newKey, err := crypto.UnmarshalPublicKey(kb)
if err != nil {
log.Warnf("%s cannot unmarshal key from remote peer: %s, %s", lp, rp, err)
return