aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorAndy <mortimer.tyrannus@gmail.com>2015-04-21 05:05:13 +0800
committerAndy <mortimer.tyrannus@gmail.com>2015-04-21 05:05:13 +0800
commit8d85e45c7d4fb294d1ba3030000c32f7babbbd13 (patch)
tree1d3e1e2e5328ca17c1aa7f3eb688b44f4edb2adb /cmd
parent59a7405a8072b735472de885c33c2a82fcf7a162 (diff)
parent99e825ad96e7b3f655f170a52ad6e408b6feb311 (diff)
downloaddexon-8d85e45c7d4fb294d1ba3030000c32f7babbbd13.tar
dexon-8d85e45c7d4fb294d1ba3030000c32f7babbbd13.tar.gz
dexon-8d85e45c7d4fb294d1ba3030000c32f7babbbd13.tar.bz2
dexon-8d85e45c7d4fb294d1ba3030000c32f7babbbd13.tar.lz
dexon-8d85e45c7d4fb294d1ba3030000c32f7babbbd13.tar.xz
dexon-8d85e45c7d4fb294d1ba3030000c32f7babbbd13.tar.zst
dexon-8d85e45c7d4fb294d1ba3030000c32f7babbbd13.zip
syncing to develop
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/admin.go8
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 {