mirror of
https://github.com/status-im/nim-libp2p-dht.git
synced 2025-02-23 17:48:21 +00:00
add ValueGetFrom count for naive getValue
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
55aa70c78a
commit
026ede7201
@ -130,6 +130,7 @@ const
|
||||
MaxProvidersEntries* = 1_000_000 # one million records
|
||||
MaxProvidersPerEntry* = 20 # providers per entry
|
||||
ValueReplication = 5 # store a value in this many nodes
|
||||
ValueGetFrom = 5 # try to get value from this many nodes (naive lookup based implementation)
|
||||
## call
|
||||
|
||||
func shortLog*(record: SignedPeerRecord): string =
|
||||
@ -895,7 +896,7 @@ proc getValue*(
|
||||
let nodesNearby = await d.lookup(cId)
|
||||
trace "nearby:", nodesNearby
|
||||
var providersFut: seq[Future[DiscResult[ValueMessage]]]
|
||||
for n in nodesNearby:
|
||||
for n in nodesNearby[0 .. ValueGetFrom]:
|
||||
if n != d.localNode:
|
||||
providersFut.add(d.sendGetValue(n, cId))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user