Browse Source

revert adding dial_peers's private flag

pull/1282/head
Anton Kaliaev 7 years ago
parent
commit
a40518c7da
No known key found for this signature in database GPG Key ID: 7B6881D965918214
4 changed files with 8 additions and 12 deletions
  1. +2
    -2
      rpc/client/localclient.go
  2. +2
    -2
      rpc/client/mock/client.go
  3. +3
    -7
      rpc/core/net.go
  4. +1
    -1
      rpc/core/routes.go

+ 2
- 2
rpc/client/localclient.go View File

@ -88,8 +88,8 @@ func (Local) DialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error) {
return core.UnsafeDialSeeds(seeds)
}
func (Local) DialPeers(peers []string, persistent bool, private bool) (*ctypes.ResultDialPeers, error) {
return core.UnsafeDialPeers(peers, persistent, private)
func (Local) DialPeers(peers []string, persistent bool) (*ctypes.ResultDialPeers, error) {
return core.UnsafeDialPeers(peers, persistent)
}
func (Local) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) {


+ 2
- 2
rpc/client/mock/client.go View File

@ -110,8 +110,8 @@ func (c Client) DialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error) {
return core.UnsafeDialSeeds(seeds)
}
func (c Client) DialPeers(peers []string, persistent bool, private bool) (*ctypes.ResultDialPeers, error) {
return core.UnsafeDialPeers(peers, persistent, private)
func (c Client) DialPeers(peers []string, persistent bool) (*ctypes.ResultDialPeers, error) {
return core.UnsafeDialPeers(peers, persistent)
}
func (c Client) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) {


+ 3
- 7
rpc/core/net.go View File

@ -2,7 +2,7 @@ package core
import (
"github.com/pkg/errors"
p2p "github.com/tendermint/tendermint/p2p"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
)
@ -67,17 +67,13 @@ func UnsafeDialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error) {
return &ctypes.ResultDialSeeds{"Dialing seeds in progress. See /net_info for details"}, nil
}
func UnsafeDialPeers(peers []string, persistent bool, private bool) (*ctypes.ResultDialPeers, error) {
func UnsafeDialPeers(peers []string, persistent bool) (*ctypes.ResultDialPeers, error) {
if len(peers) == 0 {
return &ctypes.ResultDialPeers{}, errors.New("No peers provided")
}
// starts go routines to dial each peer after random delays
logger.Info("DialPeers", "addrBook", addrBook, "peers", peers, "persistent", persistent)
var ab p2p.AddrBook
if !private {
ab = addrBook
}
err := p2pSwitch.DialPeersAsync(ab, peers, persistent)
err := p2pSwitch.DialPeersAsync(addrBook, peers, persistent)
if err != nil {
return &ctypes.ResultDialPeers{}, err
}


+ 1
- 1
rpc/core/routes.go View File

@ -39,7 +39,7 @@ var Routes = map[string]*rpc.RPCFunc{
func AddUnsafeRoutes() {
// control API
Routes["dial_seeds"] = rpc.NewRPCFunc(UnsafeDialSeeds, "seeds")
Routes["dial_peers"] = rpc.NewRPCFunc(UnsafeDialPeers, "peers,persistent,private")
Routes["dial_peers"] = rpc.NewRPCFunc(UnsafeDialPeers, "peers,persistent")
Routes["unsafe_flush_mempool"] = rpc.NewRPCFunc(UnsafeFlushMempool, "")
// profiler API


Loading…
Cancel
Save