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 not set in function param, then set default for swarm network, will be overwritten by config file if present
if networkId == 0 { if networkId == 0 {
self.NetworkId = network.NetworkId self.NetworkId = network.NetworkID
} }
if err != nil { 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) { func (k *Kademlia) EachConn(base []byte, o int, f func(OverlayConn, int, bool) bool) {
k.lock.RLock() k.lock.RLock()
defer k.lock.RUnlock() 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 { if len(base) == 0 {
base = k.base base = k.base
} }

View file

@ -368,7 +368,7 @@ func NewLocalSwarm(datadir, port string) (self *Swarm, err error) {
return return
} }
config, err := api.NewConfig(datadir, common.Address{}, prvKey, network.NetworkId) config, err := api.NewConfig(datadir, common.Address{}, prvKey, network.NetworkID)
if err != nil { if err != nil {
return return
} }