diff options
author | Bas van Kervel <basvankervel@ziggo.nl> | 2015-04-16 18:56:51 +0800 |
---|---|---|
committer | Bas van Kervel <basvankervel@ziggo.nl> | 2015-04-16 18:56:51 +0800 |
commit | 57f93d25bd9a09f4a68307342ad44a5af1d5dc26 (patch) | |
tree | 9101de89d424d7ddf4c62d3390a528193dbb274b /cmd/geth | |
parent | 205378016fc342a9ee683b3d040b3e7d0e2ebb51 (diff) | |
download | dexon-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar.gz dexon-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar.zst dexon-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.zip |
admin.stopRPC support added which stops the RPC HTTP listener
Diffstat (limited to 'cmd/geth')
-rw-r--r-- | cmd/geth/admin.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index f8c717187..3b37cba75 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -26,6 +26,7 @@ func (js *jsre) adminBindings() { admin := t.Object() admin.Set("suggestPeer", js.suggestPeer) admin.Set("startRPC", js.startRPC) + admin.Set("stopRPC", js.stopRPC) admin.Set("nodeInfo", js.nodeInfo) admin.Set("peers", js.peers) admin.Set("newAccount", js.newAccount) @@ -141,6 +142,13 @@ func (js *jsre) startRPC(call otto.FunctionCall) otto.Value { return otto.TrueValue() } +func (js *jsre) stopRPC(call otto.FunctionCall) otto.Value { + if rpc.Stop() == nil { + return otto.TrueValue() + } + return otto.FalseValue() +} + func (js *jsre) suggestPeer(call otto.FunctionCall) otto.Value { nodeURL, err := call.Argument(0).ToString() if err != nil { |