diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-07 16:53:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-07 16:53:25 +0800 |
commit | 9dab7dcc3c99d387ad2c0a1623b574d3023bdfae (patch) | |
tree | 8f98cce69568d29a954410e18dce8c121d25592e /ethereum.go | |
parent | d40cba3042564f3471aa20a5cf477cafcacc2189 (diff) | |
parent | b958179263aa1fa5060dd5d5848b8bb092a4165c (diff) | |
download | go-tangerine-9dab7dcc3c99d387ad2c0a1623b574d3023bdfae.tar go-tangerine-9dab7dcc3c99d387ad2c0a1623b574d3023bdfae.tar.gz go-tangerine-9dab7dcc3c99d387ad2c0a1623b574d3023bdfae.tar.bz2 go-tangerine-9dab7dcc3c99d387ad2c0a1623b574d3023bdfae.tar.lz go-tangerine-9dab7dcc3c99d387ad2c0a1623b574d3023bdfae.tar.xz go-tangerine-9dab7dcc3c99d387ad2c0a1623b574d3023bdfae.tar.zst go-tangerine-9dab7dcc3c99d387ad2c0a1623b574d3023bdfae.zip |
Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go index f4c497ca4..69fcc338e 100644 --- a/ethereum.go +++ b/ethereum.go @@ -6,6 +6,7 @@ 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" @@ -71,7 +72,7 @@ type Ethereum struct { listening bool - reactor *ethutil.ReactorEngine + reactor *ethreact.ReactorEngine RpcServer *ethrpc.JsonRpcServer @@ -106,7 +107,7 @@ func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager keyManager: keyManager, clientIdentity: clientIdentity, } - ethereum.reactor = ethutil.NewReactorEngine() + ethereum.reactor = ethreact.New() ethereum.txPool = ethchain.NewTxPool(ethereum) ethereum.blockChain = ethchain.NewBlockChain(ethereum) @@ -118,7 +119,7 @@ func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager return ethereum, nil } -func (s *Ethereum) Reactor() *ethutil.ReactorEngine { +func (s *Ethereum) Reactor() *ethreact.ReactorEngine { return s.reactor } @@ -350,6 +351,7 @@ 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 { @@ -463,6 +465,9 @@ func (s *Ethereum) Stop() { s.txPool.Stop() s.stateManager.Stop() + s.reactor.Flush() + s.reactor.Stop() + ethlogger.Infoln("Server stopped") close(s.shutdownChan) } |