aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@ziggo.nl>2015-04-16 18:56:51 +0800
committerBas van Kervel <basvankervel@ziggo.nl>2015-04-16 18:56:51 +0800
commit57f93d25bd9a09f4a68307342ad44a5af1d5dc26 (patch)
tree9101de89d424d7ddf4c62d3390a528193dbb274b /cmd
parent205378016fc342a9ee683b3d040b3e7d0e2ebb51 (diff)
downloadgo-tangerine-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar
go-tangerine-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar.gz
go-tangerine-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar.bz2
go-tangerine-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar.lz
go-tangerine-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar.xz
go-tangerine-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.tar.zst
go-tangerine-57f93d25bd9a09f4a68307342ad44a5af1d5dc26.zip
admin.stopRPC support added which stops the RPC HTTP listener
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 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 {