aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/admin.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/geth/admin.go')
-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 {