diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-21 21:46:26 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-21 21:46:26 +0800 |
commit | 0af0f0d890120e007ce42f072e1ee179a62115d3 (patch) | |
tree | 5ae9ecafbb729d1636fadfcfa49fd9100959560c /ethrpc/server.go | |
parent | d761af84c83ae8d9d723e6766abb7950ff59cdf3 (diff) | |
parent | c173e9f4ab463cf3a44d35215bc29d846d6f6b02 (diff) | |
download | dexon-0af0f0d890120e007ce42f072e1ee179a62115d3.tar.gz dexon-0af0f0d890120e007ce42f072e1ee179a62115d3.tar.zst dexon-0af0f0d890120e007ce42f072e1ee179a62115d3.zip |
Merge branch 'release/0.6.3'
Diffstat (limited to 'ethrpc/server.go')
-rw-r--r-- | ethrpc/server.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ethrpc/server.go b/ethrpc/server.go index d9d6f695b..4abe29aa9 100644 --- a/ethrpc/server.go +++ b/ethrpc/server.go @@ -2,11 +2,12 @@ package ethrpc import ( "fmt" - "github.com/ethereum/eth-go/ethlog" - "github.com/ethereum/eth-go/ethpub" "net" "net/rpc" "net/rpc/jsonrpc" + + "github.com/ethereum/eth-go/ethlog" + "github.com/ethereum/eth-go/ethpipe" ) var logger = ethlog.NewLogger("JSON") @@ -14,7 +15,7 @@ var logger = ethlog.NewLogger("JSON") type JsonRpcServer struct { quit chan bool listener net.Listener - ethp *ethpub.PEthereum + pipe *ethpipe.JSPipe } func (s *JsonRpcServer) exitHandler() { @@ -37,7 +38,7 @@ func (s *JsonRpcServer) Stop() { func (s *JsonRpcServer) Start() { logger.Infoln("Starting JSON-RPC server") go s.exitHandler() - rpc.Register(&EthereumApi{ethp: s.ethp}) + rpc.Register(&EthereumApi{pipe: s.pipe}) rpc.HandleHTTP() for { @@ -51,7 +52,7 @@ func (s *JsonRpcServer) Start() { } } -func NewJsonRpcServer(ethp *ethpub.PEthereum, port int) (*JsonRpcServer, error) { +func NewJsonRpcServer(pipe *ethpipe.JSPipe, port int) (*JsonRpcServer, error) { sport := fmt.Sprintf(":%d", port) l, err := net.Listen("tcp", sport) if err != nil { @@ -61,6 +62,6 @@ func NewJsonRpcServer(ethp *ethpub.PEthereum, port int) (*JsonRpcServer, error) return &JsonRpcServer{ listener: l, quit: make(chan bool), - ethp: ethp, + pipe: pipe, }, nil } |