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…
Reference in New Issue