diff options
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ethereum.go b/ethereum.go index de4e915a1..2806dfd9d 100644 --- a/ethereum.go +++ b/ethereum.go @@ -6,7 +6,6 @@ import ( "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethcrypto" "github.com/ethereum/eth-go/ethlog" - "github.com/ethereum/eth-go/ethreact" "github.com/ethereum/eth-go/ethrpc" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethwire" @@ -21,6 +20,8 @@ import ( "time" ) +const seedTextFileUri string = "http://www.ethereum.org/servers.poc3.txt" + var ethlogger = ethlog.NewLogger("SERV") func eachPeer(peers *list.List, callback func(*Peer, *list.Element)) { @@ -72,7 +73,7 @@ type Ethereum struct { listening bool - reactor *ethreact.ReactorEngine + reactor *ethutil.ReactorEngine RpcServer *ethrpc.JsonRpcServer @@ -107,7 +108,7 @@ func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager keyManager: keyManager, clientIdentity: clientIdentity, } - ethereum.reactor = ethreact.New() + ethereum.reactor = ethutil.NewReactorEngine() ethereum.txPool = ethchain.NewTxPool(ethereum) ethereum.blockChain = ethchain.NewBlockChain(ethereum) @@ -119,7 +120,7 @@ func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager return ethereum, nil } -func (s *Ethereum) Reactor() *ethreact.ReactorEngine { +func (s *Ethereum) Reactor() *ethutil.ReactorEngine { return s.reactor } @@ -351,7 +352,6 @@ func (s *Ethereum) ReapDeadPeerHandler() { // Start the ethereum func (s *Ethereum) Start(seed bool) { - s.reactor.Start() // Bind to addr and port ln, err := net.Listen("tcp", ":"+s.Port) if err != nil { @@ -418,7 +418,7 @@ func (s *Ethereum) Seed() { s.ProcessPeerList(peers) } else { // Fallback to servers.poc3.txt - resp, err := http.Get("http://www.ethereum.org/servers.poc3.txt") + resp, err := http.Get(seedTextFileUri) if err != nil { ethlogger.Warnln("Fetching seed failed:", err) return @@ -463,9 +463,6 @@ func (s *Ethereum) Stop() { s.txPool.Stop() s.stateManager.Stop() - s.reactor.Flush() - s.reactor.Stop() - ethlogger.Infoln("Server stopped") close(s.shutdownChan) } |