diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-11 03:59:31 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-11 03:59:31 +0800 |
commit | 5a83114efd96bb8debeb3a3fccc3e054069e5400 (patch) | |
tree | 6c9ef413f17582071ac81d4a67fdfc9e6bd15834 /ethereum.go | |
parent | 42123b439683725b71bbec8ee9ec7443a1af1214 (diff) | |
download | go-tangerine-5a83114efd96bb8debeb3a3fccc3e054069e5400.tar go-tangerine-5a83114efd96bb8debeb3a3fccc3e054069e5400.tar.gz go-tangerine-5a83114efd96bb8debeb3a3fccc3e054069e5400.tar.bz2 go-tangerine-5a83114efd96bb8debeb3a3fccc3e054069e5400.tar.lz go-tangerine-5a83114efd96bb8debeb3a3fccc3e054069e5400.tar.xz go-tangerine-5a83114efd96bb8debeb3a3fccc3e054069e5400.tar.zst go-tangerine-5a83114efd96bb8debeb3a3fccc3e054069e5400.zip |
Seed bootstrapping added
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ethereum.go b/ethereum.go index cc3f1695b..cac442dfc 100644 --- a/ethereum.go +++ b/ethereum.go @@ -6,8 +6,10 @@ import ( "github.com/ethereum/ethdb-go" "github.com/ethereum/ethutil-go" "github.com/ethereum/ethwire-go" + "io/ioutil" "log" "net" + "net/http" "strconv" "sync" "sync/atomic" @@ -243,6 +245,20 @@ func (s *Ethereum) Start() { // Start the tx pool s.TxPool.Start() + + resp, err := http.Get("http://www.ethereum.org/servers.poc2.txt") + if err != nil { + log.Println("Fetching seed failed:", err) + return + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + log.Println("Reading seed failed:", err) + return + } + + s.ConnectToPeer(string(body)) } func (s *Ethereum) peerHandler(listener net.Listener) { |