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

style constify variables

good to const until it's required for them to be variable.

TODO pass them in as configuration options
上级 8bef1dce
......@@ -24,13 +24,17 @@ import (
var log = eventlog.Logger("bitswap")
// Number of providers to request for sending a wantlist to
// TODO: if a 'non-nice' strategy is implemented, consider increasing this value
const maxProvidersPerRequest = 3
const (
// Number of providers to request for sending a wantlist to
// TODO: if a 'non-nice' strategy is implemented, consider increasing this value
maxProvidersPerRequest = 3
providerRequestTimeout = time.Second * 10
hasBlockTimeout = time.Second * 15
)
var providerRequestTimeout = time.Second * 10
var hasBlockTimeout = time.Second * 15
var rebroadcastDelay = time.Second * 10
var (
rebroadcastDelay = time.Second * 10
)
// New initializes a BitSwap instance that communicates over the provided
// BitSwapNetwork. This function registers the returned instance as the network
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论