DialSeeds takes an AddrBook

This commit is contained in:
Ethan Buchman
2017-03-05 23:13:34 -05:00
parent cfc7fed31c
commit 1208296dc0
4 changed files with 24 additions and 36 deletions

View File

@ -24,7 +24,7 @@ type P2P interface {
NumPeers() (outbound, inbound, dialig int)
NodeInfo() *p2p.NodeInfo
IsListening() bool
DialSeeds([]string) error
DialSeeds(*p2p.AddrBook, []string) error
}
//----------------------------------------------
@ -42,8 +42,9 @@ var (
p2pSwitch P2P
// objects
pubKey crypto.PubKey
genDoc *types.GenesisDoc // cache the genesis structure
pubKey crypto.PubKey
genDoc *types.GenesisDoc // cache the genesis structure
addrBook *p2p.AddrBook
)
func SetConfig(c cfg.Config) {
@ -78,6 +79,10 @@ func SetGenesisDoc(doc *types.GenesisDoc) {
genDoc = doc
}
func SetAddrBook(book *p2p.AddrBook) {
addrBook = book
}
func SetProxyAppQuery(appConn proxy.AppConnQuery) {
proxyAppQuery = appConn
}