From a495a014afd5037b3f4fe6ccfdbabd4cec640c1a Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Tue, 16 Dec 2014 20:09:57 -0800 Subject: [PATCH] style constify variables good to const until it's required for them to be variable. TODO pass them in as configuration options --- exchange/bitswap/bitswap.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index 57ae6a6ac..e95ffbc4f 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -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