Merge pull request #1222 from waku-org/fix/peer-tag-discovery

This commit is contained in:
fryorcraken.eth 2023-03-10 10:14:31 +11:00 committed by GitHub
commit 98695f12e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -96,6 +96,13 @@ export class PeerDiscoveryDns
if (!this._started) return;
const peerInfos = multiaddrsToPeerInfo(peer.getFullMultiaddrs());
peerInfos.forEach(async (peerInfo) => {
if (
(await this._components.peerStore.getTags(peerInfo.id)).find(
({ name }) => name === DEFAULT_BOOTSTRAP_TAG_NAME
)
)
return;
await this._components.peerStore.tagPeer(
peerInfo.id,
DEFAULT_BOOTSTRAP_TAG_NAME,

View File

@ -170,8 +170,6 @@ export class PeerExchangeDiscovery
if (!peerId || !multiaddrs || multiaddrs.length === 0) continue;
if (await this.components.peerStore.has(peerId)) continue;
if (
(await this.components.peerStore.getTags(peerId)).find(
({ name }) => name === DEFAULT_PEER_EXCHANGE_TAG_NAME