diff options
author | Felix Lange <fjl@twurst.com> | 2016-07-12 23:47:15 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-07-23 05:21:27 +0800 |
commit | 91b769042857f542b2792b23ec407e1c9bd4fe8d (patch) | |
tree | f6730b3e85a7ac5ca98f9a716505349958fcacd3 /node/node.go | |
parent | bb01bea4e276dad359815c682a2dee730737f4dc (diff) | |
download | dexon-91b769042857f542b2792b23ec407e1c9bd4fe8d.tar.gz dexon-91b769042857f542b2792b23ec407e1c9bd4fe8d.tar.zst dexon-91b769042857f542b2792b23ec407e1c9bd4fe8d.zip |
rpc: add new client, use it everywhere
The new client implementation supports concurrent requests,
subscriptions and replaces the various ad hoc RPC clients
throughout go-ethereum.
Diffstat (limited to 'node/node.go')
-rw-r--r-- | node/node.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/node/node.go b/node/node.go index 1f517a027..ac8a7e8f0 100644 --- a/node/node.go +++ b/node/node.go @@ -505,16 +505,14 @@ func (n *Node) Restart() error { } // Attach creates an RPC client attached to an in-process API handler. -func (n *Node) Attach() (rpc.Client, error) { +func (n *Node) Attach() (*rpc.Client, error) { n.lock.RLock() defer n.lock.RUnlock() - // Short circuit if the node's not running if n.server == nil { return nil, ErrNodeStopped } - // Otherwise attach to the API and return - return rpc.NewInProcRPCClient(n.inprocHandler), nil + return rpc.DialInProc(n.inprocHandler), nil } // Server retrieves the currently running P2P network layer. This method is meant |