diff options
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/eth/backend.go b/eth/backend.go index b7b5c5f85..43e757435 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -17,10 +17,6 @@ import ( "github.com/ethereum/go-ethereum/whisper" ) -const ( - seedNodeAddress = "poc-8.ethdev.com:30303" -) - type Config struct { Name string Version string @@ -141,14 +137,13 @@ func New(config *Config) (*Ethereum, error) { if err != nil { return nil, err } - fmt.Println(nat) eth.net = &p2p.Server{ Identity: clientId, MaxPeers: config.MaxPeers, Protocols: protocols, Blacklist: eth.blacklist, - NAT: p2p.UPNP(), + NAT: nat, NoDial: !config.Dial, } @@ -224,7 +219,7 @@ func (s *Ethereum) Coinbase() []byte { } // Start the ethereum -func (s *Ethereum) Start(seed bool) error { +func (s *Ethereum) Start(seedNode string) error { err := s.net.Start() if err != nil { return err @@ -247,9 +242,9 @@ func (s *Ethereum) Start(seed bool) error { go s.blockBroadcastLoop() // TODO: read peers here - if seed { - logger.Infof("Connect to seed node %v", seedNodeAddress) - if err := s.SuggestPeer(seedNodeAddress); err != nil { + if len(seedNode) > 0 { + logger.Infof("Connect to seed node %v", seedNode) + if err := s.SuggestPeer(seedNode); err != nil { logger.Infoln(err) } } |