Browse Source

rpc: dial_seeds msg. addresses #403

pull/441/merge
Ethan Buchman 8 years ago
parent
commit
585ce45a5e
2 changed files with 11 additions and 1 deletions
  1. +10
    -1
      rpc/core/net.go
  2. +1
    -0
      rpc/core/types/responses.go

+ 10
- 1
rpc/core/net.go View File

@ -1,6 +1,8 @@
package core package core
import ( import (
"fmt"
ctypes "github.com/tendermint/tendermint/rpc/core/types" ctypes "github.com/tendermint/tendermint/rpc/core/types"
) )
@ -31,10 +33,17 @@ func NetInfo() (*ctypes.ResultNetInfo, error) {
// Dial given list of seeds // Dial given list of seeds
func UnsafeDialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error) { func UnsafeDialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error) {
if len(seeds) == 0 {
return &ctypes.ResultDialSeeds{}, fmt.Errorf("No seeds provided")
}
// starts go routines to dial each seed after random delays // starts go routines to dial each seed after random delays
log.Info("DialSeeds", "addrBook", addrBook, "seeds", seeds) log.Info("DialSeeds", "addrBook", addrBook, "seeds", seeds)
err := p2pSwitch.DialSeeds(addrBook, seeds) err := p2pSwitch.DialSeeds(addrBook, seeds)
return &ctypes.ResultDialSeeds{}, err
if err != nil {
return &ctypes.ResultDialSeeds{}, err
}
return &ctypes.ResultDialSeeds{"Dialing seeds in progress. See /net_info for details"}, nil
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------


+ 1
- 0
rpc/core/types/responses.go View File

@ -45,6 +45,7 @@ type ResultNetInfo struct {
} }
type ResultDialSeeds struct { type ResultDialSeeds struct {
Log string `json:"log"`
} }
type Peer struct { type Peer struct {


Loading…
Cancel
Save