From 9b4b6555e713e9d566911f519dd9669887c3f7fd Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Thu, 6 Aug 2020 11:40:20 +0200 Subject: [PATCH] fix: persisted keybook recheck keybook content for delete --- src/peer-store/persistent/index.js | 2 +- test/fixtures/browser.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/peer-store/persistent/index.js b/src/peer-store/persistent/index.js index 0cf54c0d9e..8a3cb777ce 100644 --- a/src/peer-store/persistent/index.js +++ b/src/peer-store/persistent/index.js @@ -210,7 +210,7 @@ class PersistentPeerStore extends PeerStore { try { // Deleted from the book - if (!peerId.pubKey) { + if (!this.keyBook.data.get(peerId.toB58String())) { batch.delete(key) return } diff --git a/test/fixtures/browser.js b/test/fixtures/browser.js index 3b2c02654a..f5f33259dc 100644 --- a/test/fixtures/browser.js +++ b/test/fixtures/browser.js @@ -3,5 +3,5 @@ const multiaddr = require('multiaddr') module.exports.MULTIADDRS_WEBSOCKETS = [ -multiaddr('/ip4/127.0.0.1/tcp/15001/ws/p2p/12D3KooWHFKTMzwerBtsVmtz4ZZEQy2heafxzWw6wNn5PPYkBxJ5') + multiaddr('/ip4/127.0.0.1/tcp/15001/ws/p2p/12D3KooWHFKTMzwerBtsVmtz4ZZEQy2heafxzWw6wNn5PPYkBxJ5') ]