@libp2p/kad-dht 8.0.12 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,13 +51,13 @@ export class GetValueHandler implements DHTMessageHandler {
51
51
  let pubKey: Uint8Array | undefined
52
52
 
53
53
  try {
54
- const key = await this.components.peerStore.keyBook.get(idFromKey)
54
+ const peer = await this.components.peerStore.get(idFromKey)
55
55
 
56
- if (key == null) {
56
+ if (peer.id.publicKey == null) {
57
57
  throw new CodeError('No public key found in key book', 'ERR_NOT_FOUND')
58
58
  }
59
59
 
60
- pubKey = key
60
+ pubKey = peer.id.publicKey
61
61
  } catch (err: any) {
62
62
  if (err.code !== 'ERR_NOT_FOUND') {
63
63
  throw err