diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-02 21:37:44 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-02 21:37:44 +0800 |
commit | b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234 (patch) | |
tree | cd41adf9e85979d8c4d9b694b878aa1b49f13ea2 /rpc/ws/server.go | |
parent | 7139c1aff7ef9da9131598f7eb67bb0d1ed13b6c (diff) | |
download | dexon-b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234.tar dexon-b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234.tar.gz dexon-b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234.tar.bz2 dexon-b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234.tar.lz dexon-b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234.tar.xz dexon-b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234.tar.zst dexon-b2b42f759c54d9d1b0ba4d9419a4c9a4bd8e4234.zip |
Update signature for rpc websockets
Diffstat (limited to 'rpc/ws/server.go')
-rw-r--r-- | rpc/ws/server.go | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/rpc/ws/server.go b/rpc/ws/server.go index 2853181ec..85cacf80b 100644 --- a/rpc/ws/server.go +++ b/rpc/ws/server.go @@ -22,8 +22,6 @@ import ( "net/http" "code.google.com/p/go.net/websocket" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/event/filter" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/xeth" @@ -32,25 +30,21 @@ import ( var wslogger = logger.NewLogger("RPC-WS") type WebSocketServer struct { - eth *eth.Ethereum - filterManager *filter.FilterManager - port int - doneCh chan bool - listener net.Listener + pipe *xeth.XEth + port int + doneCh chan bool + listener net.Listener } -func NewWebSocketServer(eth *eth.Ethereum, port int) (*WebSocketServer, error) { +func NewWebSocketServer(pipe *xeth.XEth, port int) (*WebSocketServer, error) { sport := fmt.Sprintf(":%d", port) l, err := net.Listen("tcp", sport) if err != nil { return nil, err } - filterManager := filter.NewFilterManager(eth.EventMux()) - go filterManager.Start() - - return &WebSocketServer{eth, - filterManager, + return &WebSocketServer{ + pipe, port, make(chan bool), l, @@ -75,7 +69,7 @@ func (self *WebSocketServer) Start() { wslogger.Infof("Starting RPC-WS server on port %d", self.port) go self.handlerLoop() - api := rpc.NewEthereumApi(xeth.New(self.eth)) + api := rpc.NewEthereumApi(self.pipe) h := self.apiHandler(api) http.Handle("/ws", h) |