mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
swarm/network: cmdline network id highest precedence
Already fixed in previous commits, but separate commit for this issue requested. Added comments to explain why test against 0 appears twice fixes #3444 fixes #3494
This commit is contained in:
parent
6dbde1f889
commit
2f8a3dde62
1 changed files with 2 additions and 0 deletions
|
|
@ -86,6 +86,7 @@ func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey, n
|
|||
}
|
||||
data, err = ioutil.ReadFile(confpath)
|
||||
|
||||
// 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
|
||||
}
|
||||
|
|
@ -117,6 +118,7 @@ func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey, n
|
|||
return nil, fmt.Errorf("bzz key does not match the one in the config file %v != %v", keyhex, self.BzzKey)
|
||||
}
|
||||
|
||||
// if set in function param, replace id set from config file
|
||||
if networkId != 0 {
|
||||
self.NetworkId = networkId
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue