mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 06:53:46 +00:00
pot, swarm/network: cleanup, fix depth in kad table
This commit is contained in:
parent
72517463c8
commit
61b45b767a
3 changed files with 7 additions and 3 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
|
||||||
dpaChunkStore := storage.NewDpaChunkStore(self.lstore, self.storage)
|
dpaChunkStore := storage.NewDpaChunkStore(self.lstore, self.storage)
|
||||||
log.Debug(fmt.Sprintf("-> Local Access to Swarm"))
|
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)
|
self.dpa = storage.NewDPA(dpaChunkStore, self.config.ChunkerParams)
|
||||||
log.Debug(fmt.Sprintf("-> Content Store API"))
|
log.Debug(fmt.Sprintf("-> Content Store API"))
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue