diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-21 01:34:50 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-21 01:34:50 +0800 |
commit | 99e825ad96e7b3f655f170a52ad6e408b6feb311 (patch) | |
tree | 06f41da20ebc0b759f839c396e5bc1ad79cc3055 /cmd/geth | |
parent | 3d7c1b8194e509f61fb64a129242b3170ecffd08 (diff) | |
parent | 61885aa965282d5879b9c4fbb740e96e9b680558 (diff) | |
download | dexon-99e825ad96e7b3f655f170a52ad6e408b6feb311.tar dexon-99e825ad96e7b3f655f170a52ad6e408b6feb311.tar.gz dexon-99e825ad96e7b3f655f170a52ad6e408b6feb311.tar.bz2 dexon-99e825ad96e7b3f655f170a52ad6e408b6feb311.tar.lz dexon-99e825ad96e7b3f655f170a52ad6e408b6feb311.tar.xz dexon-99e825ad96e7b3f655f170a52ad6e408b6feb311.tar.zst dexon-99e825ad96e7b3f655f170a52ad6e408b6feb311.zip |
Merge pull request #734 from bas-vk/issue-729
admin.StopRPC added to console
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 defbb43ec..bd09291bf 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -28,6 +28,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) @@ -226,6 +227,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 { |