mirror of https://codeberg.org/pzp/pzp-sync.git
fix calculation of wantRange for newest goal
We shouldn't use maxLocalHave+1 because we are interested in EVERYTHING the remote peer has, as long as it is inside the "size" defined for this goal. Bloom filters will then make sure we are not getting what we already have in this range.
This commit is contained in:
parent
eff0c57517
commit
4637a24960
|
@ -75,7 +75,7 @@ class Algorithm {
|
||||||
if (maxRemoteHave <= maxLocalHave) return EMPTY_RANGE
|
if (maxRemoteHave <= maxLocalHave) return EMPTY_RANGE
|
||||||
const maxWant = maxRemoteHave
|
const maxWant = maxRemoteHave
|
||||||
const size = Math.max(maxWant - maxLocalHave, count)
|
const size = Math.max(maxWant - maxLocalHave, count)
|
||||||
const minWant = Math.max(maxWant - size, maxLocalHave + 1, minRemoteHave)
|
const minWant = Math.max(maxWant - size, minRemoteHave)
|
||||||
return [minWant, maxWant]
|
return [minWant, maxWant]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue