diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-01 16:22:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-01 16:22:25 +0800 |
commit | 8bed47a2d4377b7a49f34350ae5c5ea50464b95d (patch) | |
tree | 3b1923c6560da3a08bfb88783e49b353f2609ea9 /ethereum.go | |
parent | 5a2d62e4d9e551f16f094216da70b7a6f5d2bf00 (diff) | |
parent | 9831619881c5264c2449ce1b906108d892b6e1e1 (diff) | |
download | go-tangerine-8bed47a2d4377b7a49f34350ae5c5ea50464b95d.tar go-tangerine-8bed47a2d4377b7a49f34350ae5c5ea50464b95d.tar.gz go-tangerine-8bed47a2d4377b7a49f34350ae5c5ea50464b95d.tar.bz2 go-tangerine-8bed47a2d4377b7a49f34350ae5c5ea50464b95d.tar.lz go-tangerine-8bed47a2d4377b7a49f34350ae5c5ea50464b95d.tar.xz go-tangerine-8bed47a2d4377b7a49f34350ae5c5ea50464b95d.tar.zst go-tangerine-8bed47a2d4377b7a49f34350ae5c5ea50464b95d.zip |
Merge branch 'feature/ethutil-refactor' of https://github.com/ethersphere/eth-go into ethersphere-feature/ethutil-refactor
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go index 395eba954..69bb93cff 100644 --- a/ethereum.go +++ b/ethereum.go @@ -14,6 +14,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" @@ -75,7 +76,7 @@ type Ethereum struct { listening bool - reactor *ethutil.ReactorEngine + reactor *ethreact.ReactorEngine RpcServer *ethrpc.JsonRpcServer @@ -113,7 +114,7 @@ func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager clientIdentity: clientIdentity, isUpToDate: true, } - ethereum.reactor = ethutil.NewReactorEngine() + ethereum.reactor = ethreact.New() ethereum.txPool = ethchain.NewTxPool(ethereum) ethereum.blockChain = ethchain.NewBlockChain(ethereum) @@ -125,7 +126,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 } @@ -357,6 +358,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 { @@ -456,6 +458,8 @@ func (s *Ethereum) Stop() { } s.txPool.Stop() s.stateManager.Stop() + s.reactor.Flush() + s.reactor.Stop() ethlogger.Infoln("Server stopped") close(s.shutdownChan) |