diff options
author | zelig <viktor.tron@gmail.com> | 2014-07-15 01:50:06 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-07-15 01:50:06 +0800 |
commit | 3d5db7288f134fef7e51b25776007705f6663654 (patch) | |
tree | edda6e8fd23584327473058411df9cd2c53241f4 /ethereum.go | |
parent | dc11b5c55e2888a7a3dac51fedc3864d112136ce (diff) | |
parent | 8845fb7eae3e51fd3e55c47c377bf1a9e0cfe2a9 (diff) | |
download | dexon-3d5db7288f134fef7e51b25776007705f6663654.tar dexon-3d5db7288f134fef7e51b25776007705f6663654.tar.gz dexon-3d5db7288f134fef7e51b25776007705f6663654.tar.bz2 dexon-3d5db7288f134fef7e51b25776007705f6663654.tar.lz dexon-3d5db7288f134fef7e51b25776007705f6663654.tar.xz dexon-3d5db7288f134fef7e51b25776007705f6663654.tar.zst dexon-3d5db7288f134fef7e51b25776007705f6663654.zip |
merge upstream
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) } |