aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/hive.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/network/hive.go')
-rw-r--r--swarm/network/hive.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/swarm/network/hive.go b/swarm/network/hive.go
index d37b7e400..2504a4610 100644
--- a/swarm/network/hive.go
+++ b/swarm/network/hive.go
@@ -70,19 +70,25 @@ type HiveParams struct {
*kademlia.KadParams
}
-func NewHiveParams(path string) *HiveParams {
- kad := kademlia.NewKadParams()
+//create default params
+func NewDefaultHiveParams() *HiveParams {
+ kad := kademlia.NewDefaultKadParams()
// kad.BucketSize = bucketSize
// kad.MaxProx = maxProx
// kad.ProxBinSize = proxBinSize
return &HiveParams{
CallInterval: callInterval,
- KadDbPath: filepath.Join(path, "bzz-peers.json"),
KadParams: kad,
}
}
+//this can only finally be set after all config options (file, cmd line, env vars)
+//have been evaluated
+func (self *HiveParams) Init(path string) {
+ self.KadDbPath = filepath.Join(path, "bzz-peers.json")
+}
+
func NewHive(addr common.Hash, params *HiveParams, swapEnabled, syncEnabled bool) *Hive {
kad := kademlia.New(kademlia.Address(addr), params.KadParams)
return &Hive{