@cryptotaxi247 / kubo / commits / a495a014a

style constify variables

good to const until it's required for them to be variable. TODO pass them in as configuration options

Brian Tiger Chow committed Dec 16, 2014 at 20:09 UTC a495a014afd5037b3f4fe6ccfdbabd4cec640c1a
1 file changed +10 -6
exchange/bitswap/bitswap.go
+10 -6
@@ -24,13 +24,17 @@ import (
24
25 var log = eventlog.Logger("bitswap")
26
27 -// Number of providers to request for sending a wantlist to
28 -// TODO: if a 'non-nice' strategy is implemented, consider increasing this value
29 -const maxProvidersPerRequest = 3
27 +const (
28 + // Number of providers to request for sending a wantlist to
29 + // TODO: if a 'non-nice' strategy is implemented, consider increasing this value
30 + maxProvidersPerRequest = 3
31 + providerRequestTimeout = time.Second * 10
32 + hasBlockTimeout = time.Second * 15
33 +)
34
31 -var providerRequestTimeout = time.Second * 10
32 -var hasBlockTimeout = time.Second * 15
33 -var rebroadcastDelay = time.Second * 10
35 +var (
36 + rebroadcastDelay = time.Second * 10
37 +)
38
39 // New initializes a BitSwap instance that communicates over the provided
40 // BitSwapNetwork. This function registers the returned instance as the network