|
|
@ -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 |
|
|
|
} |
|
|
|