Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit e12e540

Browse files
jacobheunvasco-santos
authored andcommitted
fix: dont use peer ids in sets (#165)
1 parent a94f4d4 commit e12e540

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/query/path.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Path {
7373

7474
// The paths must be disjoint, meaning that no two paths in the Query may
7575
// traverse the same peer
76-
if (this.run.peersSeen.has(peer)) {
76+
if (this.run.peersSeen.has(peer.toB58String())) {
7777
return
7878
}
7979

src/query/workerQueue.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class WorkerQueue {
128128

129129
// The paths must be disjoint, meaning that no two paths in the Query may
130130
// traverse the same peer
131-
if (this.run.peersSeen.has(peer)) {
131+
if (this.run.peersSeen.has(peer.toB58String())) {
132132
return
133133
}
134134

@@ -158,10 +158,10 @@ class WorkerQueue {
158158
}
159159

160160
// Check if another path has queried this peer in the mean time
161-
if (this.run.peersSeen.has(peer)) {
161+
if (this.run.peersSeen.has(peer.toB58String())) {
162162
return
163163
}
164-
this.run.peersSeen.add(peer)
164+
this.run.peersSeen.add(peer.toB58String())
165165

166166
// Execute the query on the next peer
167167
this.log('queue:work')

0 commit comments

Comments
 (0)