mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-07-03 22:51:35 +00:00
SearchValue: Make -1 quorum mean infinite on get
This commit is contained in:
@ -157,6 +157,9 @@ func (dht *IpfsDHT) SearchValue(ctx context.Context, key string, opts ...ropts.O
|
||||
go func() {
|
||||
defer close(out)
|
||||
|
||||
if responsesNeeded < 0 {
|
||||
responsesNeeded = 0
|
||||
}
|
||||
vals := make([]RecvdVal, 0, responsesNeeded)
|
||||
best := -1
|
||||
|
||||
@ -271,7 +274,7 @@ func (dht *IpfsDHT) getValues(ctx context.Context, key string, nvals int) (<-cha
|
||||
From: dht.self,
|
||||
}
|
||||
|
||||
if nvals <= 1 {
|
||||
if nvals == 0 || nvals == 1 {
|
||||
return done(nil)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user