cmd/geth, cmd/mist, cmd/utils, eth, p2p: support trusted peers

This commit is contained in:
Péter Szilágyi
2015-04-29 18:04:08 +03:00
parent 3fef601903
commit de0549fabb
8 changed files with 146 additions and 27 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("suggestPeer", js.suggestPeer)
admin.Set("trustPeer", js.trustPeer)
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) suggestPeer(call otto.FunctionCall) otto.Value {
func (js *jsre) trustPeer(call otto.FunctionCall) otto.Value {
nodeURL, err := call.Argument(0).ToString()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
err = js.ethereum.SuggestPeer(nodeURL)
err = js.ethereum.TrustPeer(nodeURL)
if err != nil {
fmt.Println(err)
return otto.FalseValue()

View File

@ -232,7 +232,8 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.IdentityFlag,
utils.UnlockedAccountFlag,
utils.PasswordFileFlag,
utils.BootnodesFlag,
utils.BootNodesFlag,
utils.TrustedNodesFlag,
utils.DataDirFlag,
utils.BlockchainVersionFlag,
utils.JSpathFlag,