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

Commit

Permalink
chore: use peer id bytes instead of computing it again
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Nov 12, 2018
1 parent 73d3686 commit 1c98e7d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/ipns/resolver.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

const ipns = require('ipns')
const { fromB58String } = require('multihashes')
const Record = require('libp2p-record').Record
const PeerId = require('peer-id')
const errcode = require('err-code')
Expand Down Expand Up @@ -91,7 +90,7 @@ class IpnsResolver {
// resolve ipns entries from the provided routing
_resolveName (name, callback) {
const peerId = PeerId.createFromB58String(name)
const { routingKey } = ipns.getIdKeys(fromB58String(name))
const { routingKey } = ipns.getIdKeys(peerId.toBytes())

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

0 comments on commit 1c98e7d

Please sign in to comment.