Commit fde3e01f authored by Maran's avatar Maran

Fixed import cycle

parent c496aad2
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"container/list" "container/list"
"github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethdb" "github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/etherpc"
"github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire" "github.com/ethereum/eth-go/ethwire"
"io/ioutil" "io/ioutil"
...@@ -63,7 +64,7 @@ type Ethereum struct { ...@@ -63,7 +64,7 @@ type Ethereum struct {
reactor *ethutil.ReactorEngine reactor *ethutil.ReactorEngine
// TODO: This no worky: RpcServer *etherpc.JsonRpcServer RpcServer *etherpc.JsonRpcServer
} }
func New(caps Caps, usePnp bool) (*Ethereum, error) { func New(caps Caps, usePnp bool) (*Ethereum, error) {
...@@ -338,9 +339,9 @@ func (s *Ethereum) Stop() { ...@@ -338,9 +339,9 @@ func (s *Ethereum) Stop() {
close(s.quit) close(s.quit)
s.RpcServer.Stop()
s.txPool.Stop() s.txPool.Stop()
s.stateManager.Stop() s.stateManager.Stop()
// TODO: THIS NO WORKY: s.RpcServer.Stop()
close(s.shutdownChan) close(s.shutdownChan)
} }
......
...@@ -41,7 +41,7 @@ func (s *JsonRpcServer) Start() { ...@@ -41,7 +41,7 @@ func (s *JsonRpcServer) Start() {
conn, err := s.listener.Accept() conn, err := s.listener.Accept()
if err != nil { if err != nil {
ethutil.Config.Log.Infoln("[JSON] Error starting JSON-RPC:", err) ethutil.Config.Log.Infoln("[JSON] Error starting JSON-RPC:", err)
continue break
} }
ethutil.Config.Log.Debugln("[JSON] Incoming request.") ethutil.Config.Log.Debugln("[JSON] Incoming request.")
go jsonrpc.ServeConn(conn) go jsonrpc.ServeConn(conn)
......
package ethpub package ethpub
import ( import (
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethutil"
) )
...@@ -12,11 +11,11 @@ type PEthereum struct { ...@@ -12,11 +11,11 @@ type PEthereum struct {
txPool *ethchain.TxPool txPool *ethchain.TxPool
} }
func NewPEthereum(eth *eth.Ethereum) *PEthereum { func NewPEthereum(sm *ethchain.StateManager, bc *ethchain.BlockChain, txp *ethchain.TxPool) *PEthereum {
return &PEthereum{ return &PEthereum{
eth.StateManager(), sm,
eth.BlockChain(), bc,
eth.TxPool(), txp,
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment