aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-07-15 08:11:06 +0800
committerzelig <viktor.tron@gmail.com>2014-07-15 08:11:06 +0800
commit1735ec0362e84455126d8c1bd380ecae436d1167 (patch)
treee017a42d66ceecc01f798f4ee926db5cc3011083 /ethereum.go
parent0ecc5c815e4550d7e8dca7b4ab4c549b10bf0b19 (diff)
downloaddexon-1735ec0362e84455126d8c1bd380ecae436d1167.tar
dexon-1735ec0362e84455126d8c1bd380ecae436d1167.tar.gz
dexon-1735ec0362e84455126d8c1bd380ecae436d1167.tar.bz2
dexon-1735ec0362e84455126d8c1bd380ecae436d1167.tar.lz
dexon-1735ec0362e84455126d8c1bd380ecae436d1167.tar.xz
dexon-1735ec0362e84455126d8c1bd380ecae436d1167.tar.zst
dexon-1735ec0362e84455126d8c1bd380ecae436d1167.zip
use ethreact.Event and ethreact.ReactorEngine
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go
index 2806dfd9d..c2d2f5241 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"
@@ -73,7 +74,7 @@ type Ethereum struct {
listening bool
- reactor *ethutil.ReactorEngine
+ reactor *ethreact.ReactorEngine
RpcServer *ethrpc.JsonRpcServer
@@ -108,7 +109,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)
@@ -120,7 +121,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
}
@@ -352,6 +353,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 {
@@ -462,6 +464,8 @@ func (s *Ethereum) Stop() {
}
s.txPool.Stop()
s.stateManager.Stop()
+ s.reactor.Flush()
+ s.reactor.Stop()
ethlogger.Infoln("Server stopped")
close(s.shutdownChan)