pot, swarm/network: cleanup, fix depth in kad table

This commit is contained in:
zelig 2017-06-17 17:06:28 +02:00 committed by Lewis Marshall
parent 72517463c8
commit 61b45b767a
3 changed files with 7 additions and 3 deletions

View file

@ -88,7 +88,7 @@ func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey, n
// if not set in function param, then set default for swarm network, will be overwritten by config file if present
if networkId == 0 {
self.NetworkId = network.NetworkId
self.NetworkId = network.NetworkID
}
if err != nil {

View file

@ -345,6 +345,10 @@ func (k *Kademlia) Off(p OverlayConn) {
func (k *Kademlia) EachConn(base []byte, o int, f func(OverlayConn, int, bool) bool) {
k.lock.RLock()
defer k.lock.RUnlock()
k.eachConn(base, o, f)
}
func (k *Kademlia) eachConn(base []byte, o int, f func(OverlayConn, int, bool) bool) {
if len(base) == 0 {
base = k.base
}

View file

@ -133,7 +133,7 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
dpaChunkStore := storage.NewDpaChunkStore(self.lstore, self.storage)
log.Debug(fmt.Sprintf("-> Local Access to Swarm"))
// Swarm Hash Merklised Chunking for Arbitrary-length Document/File storage
// Swarm Hash Merklised Chunking for Arbitrary-length Document/File storage
self.dpa = storage.NewDPA(dpaChunkStore, self.config.ChunkerParams)
log.Debug(fmt.Sprintf("-> Content Store API"))
@ -368,7 +368,7 @@ func NewLocalSwarm(datadir, port string) (self *Swarm, err error) {
return
}
config, err := api.NewConfig(datadir, common.Address{}, prvKey, network.NetworkId)
config, err := api.NewConfig(datadir, common.Address{}, prvKey, network.NetworkID)
if err != nil {
return
}