aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-02-11 18:40:12 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-02-11 18:40:12 +0800
commitcfddb7f3cd3b8cecb1e59412ce4db5769f6c8007 (patch)
treeab28c518bd1b78f6b8ac8b241951ad161cb268a9 /eth/backend.go
parent21fd31dad8bc6e0291ca405314b516670333c707 (diff)
parentc6af5f0a275608ea6c797ef826e6090885f24eac (diff)
downloadgo-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.gz
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.bz2
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.lz
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.xz
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.zst
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.zip
Merge branch 'develop' into jsonrpc
Conflicts: rpc/ws/server.go
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go15
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)
}
}