From 2c2ec4f542fa0686744f8cdb5121096d56ce8504 Mon Sep 17 00:00:00 2001 From: lash Date: Wed, 14 Nov 2018 17:33:10 +0100 Subject: [PATCH] swarm/network: Replace ugly literals in object constructor. --- swarm/network/kademlia.go | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/swarm/network/kademlia.go b/swarm/network/kademlia.go index 33414188a6..f250b0e613 100644 --- a/swarm/network/kademlia.go +++ b/swarm/network/kademlia.go @@ -29,16 +29,6 @@ import ( "github.com/ethereum/go-ethereum/swarm/pot" ) -const ( - defaultMaxProxDisplay = 16 - defaultMinProxBinSize = 2 - defaultMinBinSize = 2 - defaultMaxBinSize = 4 - defaultRetryInterval = 4200000000 // 4.2 sec - defaultMaxRetries = 42 - defaultRetryExponent = 2 -) - /* Taking the proximity order relative to a fix point x classifies the points in @@ -78,13 +68,13 @@ type KadParams struct { // NewKadParams returns a params struct with default values func NewKadParams() *KadParams { return &KadParams{ - MaxProxDisplay: defaultMaxProxDisplay, - MinProxBinSize: defaultMinProxBinSize, - MinBinSize: defaultMinBinSize, - MaxBinSize: defaultMaxBinSize, - RetryInterval: defaultRetryInterval, - MaxRetries: defaultMaxRetries, - RetryExponent: defaultRetryExponent, + MaxProxDisplay: 16, + MinProxBinSize: 2, + MinBinSize: 2, + MaxBinSize: 4, + RetryInterval: 4200000000, // 4.2 sec + MaxRetries: 42, + RetryExponent: 2, } }