mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
"error creating swarm" message when no error fixed
This commit is contained in:
parent
c4bca77d96
commit
1cfa386536
1 changed files with 19 additions and 5 deletions
|
|
@ -88,6 +88,7 @@ type Config struct {
|
|||
Dial bool
|
||||
Bzz bool
|
||||
BzzPort string
|
||||
PowTest bool
|
||||
|
||||
Etherbase string
|
||||
GasPrice *big.Int
|
||||
|
|
@ -288,7 +289,14 @@ func New(config *Config) (*Ethereum, error) {
|
|||
AutoDAG: config.AutoDAG,
|
||||
}
|
||||
|
||||
if config.PowTest {
|
||||
eth.pow, err = ethash.NewForTesting()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
eth.pow = ethash.New()
|
||||
}
|
||||
eth.chainManager = core.NewChainManager(blockDb, stateDb, eth.pow, eth.EventMux())
|
||||
eth.downloader = downloader.New(eth.EventMux(), eth.chainManager.HasBlock, eth.chainManager.GetBlock)
|
||||
eth.txPool = core.NewTxPool(eth.EventMux(), eth.chainManager.State, eth.chainManager.GasLimit)
|
||||
|
|
@ -312,13 +320,19 @@ func New(config *Config) (*Ethereum, error) {
|
|||
|
||||
if config.Bzz {
|
||||
eth.Swarm, err = bzz.NewApi(config.DataDir, config.BzzPort)
|
||||
if err != nil {
|
||||
glog.V(logger.Warn).Infof("BZZ: error creating swarm: %v. Protocol skipped", err)
|
||||
} else {
|
||||
var proto p2p.Protocol
|
||||
proto, err = eth.Swarm.Bzz()
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
glog.V(logger.Warn).Infof("BZZ: error creating swarm: %v. Protocol skipped", err)
|
||||
eth.Swarm = nil
|
||||
} else {
|
||||
protocols = append(protocols, proto)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if config.Shh {
|
||||
protocols = append(protocols, eth.whisper.Protocol())
|
||||
|
|
|
|||
Loading…
Reference in a new issue