aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-12 01:46:28 +0800
committerobscuren <geffobscura@gmail.com>2014-02-12 01:46:28 +0800
commit02acef23d595dc2bc95295bab63658addf664aaf (patch)
treeb91e7a59b788520a995cc37cbc1a8a1621265081 /ethereum.go
parent5a83114efd96bb8debeb3a3fccc3e054069e5400 (diff)
downloadgo-tangerine-02acef23d595dc2bc95295bab63658addf664aaf.tar
go-tangerine-02acef23d595dc2bc95295bab63658addf664aaf.tar.gz
go-tangerine-02acef23d595dc2bc95295bab63658addf664aaf.tar.bz2
go-tangerine-02acef23d595dc2bc95295bab63658addf664aaf.tar.lz
go-tangerine-02acef23d595dc2bc95295bab63658addf664aaf.tar.xz
go-tangerine-02acef23d595dc2bc95295bab63658addf664aaf.tar.zst
go-tangerine-02acef23d595dc2bc95295bab63658addf664aaf.zip
Interop!
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/ethereum.go b/ethereum.go
index cac442dfc..6ace58308 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -60,8 +60,8 @@ type Ethereum struct {
}
func New(caps Caps, usePnp bool) (*Ethereum, error) {
- db, err := ethdb.NewLDBDatabase()
- //db, err := ethdb.NewMemDatabase()
+ //db, err := ethdb.NewLDBDatabase()
+ db, err := ethdb.NewMemDatabase()
if err != nil {
return nil, err
}
@@ -246,19 +246,22 @@ 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
- }
+ if ethutil.Config.Seed {
+ // Testnet seed bootstrapping
+ 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))
+ s.ConnectToPeer(string(body))
+ }
}
func (s *Ethereum) peerHandler(listener net.Listener) {