Merge pull request #734 from bas-vk/issue-729
admin.StopRPC added to console
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user