mirror of
https://github.com/status-im/nim-libp2p-dht.git
synced 2025-02-24 01:58:28 +00:00
quick fix local lookup
This commit is contained in:
parent
31d99ad56e
commit
57a339d326
@ -113,6 +113,9 @@ proc sendAddProvider*(p: ProvidersProtocol, dst: Node, cId: NodeId, pr: PeerReco
|
||||
|
||||
proc addProvider*(p: ProvidersProtocol, cId: NodeId, pr: PeerRecord): Future[seq[Node]] {.async.} =
|
||||
result = await p.discovery.lookup(cId)
|
||||
# TODO: lookup is sepcified as not returning local, even if that is the closest. Is this OK?
|
||||
if result.len == 0:
|
||||
result.add(p.discovery.localNode)
|
||||
for n in result:
|
||||
if n != p.discovery.localNode:
|
||||
p.sendAddProvider(n, cId, pr)
|
||||
|
Loading…
x
Reference in New Issue
Block a user