Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 1c98e7d

Browse files
committed
chore: use peer id bytes instead of computing it again
1 parent 73d3686 commit 1c98e7d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/core/ipns/resolver.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

33
const ipns = require('ipns')
4-
const { fromB58String } = require('multihashes')
54
const Record = require('libp2p-record').Record
65
const PeerId = require('peer-id')
76
const errcode = require('err-code')
@@ -91,7 +90,7 @@ class IpnsResolver {
9190
// resolve ipns entries from the provided routing
9291
_resolveName (name, callback) {
9392
const peerId = PeerId.createFromB58String(name)
94-
const { routingKey } = ipns.getIdKeys(fromB58String(name))
93+
const { routingKey } = ipns.getIdKeys(peerId.toBytes())
9594

9695
// TODO DHT - get public key from routing?
9796
// https://github.com/ipfs/go-ipfs/blob/master/namesys/routing.go#L70

0 commit comments

Comments
 (0)