提交 8100582e 作者: Brian Tiger Chow 提交者: Juan Batiz-Benet

fix: batches of blocks have equal priority

addresses...

https://github.com/jbenet/go-ipfs/pull/438/files#r21878994

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 bd3ee739
......@@ -3,6 +3,7 @@
package bitswap
import (
"math"
"sync"
"time"
......@@ -30,6 +31,8 @@ const (
providerRequestTimeout = time.Second * 10
hasBlockTimeout = time.Second * 15
sizeBatchRequestChan = 32
// kMaxPriority is the max priority as defined by the bitswap protocol
kMaxPriority = math.MaxInt32
)
var (
......@@ -261,7 +264,7 @@ func (bs *bitswap) clientWorker(parent context.Context) {
continue
}
for i, k := range ks {
bs.wantlist.Add(k, len(ks)-i)
bs.wantlist.Add(k, kMaxPriority-i)
}
// NB: send want list to providers for the first peer in this list.
// the assumption is made that the providers of the first key in
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论