cmd, eth, p2p: fix review issues enumerated by Felix

This commit is contained in:
Péter Szilágyi
2015-04-30 16:15:29 +03:00
parent 1528dbc171
commit 701591b403
8 changed files with 25 additions and 34 deletions

View File

@@ -25,7 +25,7 @@ func (js *jsre) adminBindings() {
js.re.Set("admin", struct{}{})
t, _ := js.re.Get("admin")
admin := t.Object()
admin.Set("trustPeer", js.trustPeer)
admin.Set("addPeer", js.addPeer)
admin.Set("startRPC", js.startRPC)
admin.Set("stopRPC", js.stopRPC)
admin.Set("nodeInfo", js.nodeInfo)
@@ -243,13 +243,13 @@ func (js *jsre) stopRPC(call otto.FunctionCall) otto.Value {
return otto.FalseValue()
}
func (js *jsre) trustPeer(call otto.FunctionCall) otto.Value {
func (js *jsre) addPeer(call otto.FunctionCall) otto.Value {
nodeURL, err := call.Argument(0).ToString()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
err = js.ethereum.TrustPeer(nodeURL)
err = js.ethereum.AddPeer(nodeURL)
if err != nil {
fmt.Println(err)
return otto.FalseValue()