remove public addr book funcs from pex
This commit is contained in:
parent
65b1756978
commit
88b5c724f2
|
@ -153,6 +153,7 @@ func (a *AddrBook) OurAddresses() []*NetAddress {
|
||||||
return addrs
|
return addrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: addr must not be nil
|
||||||
func (a *AddrBook) AddAddress(addr *NetAddress, src *NetAddress) {
|
func (a *AddrBook) AddAddress(addr *NetAddress, src *NetAddress) {
|
||||||
a.mtx.Lock()
|
a.mtx.Lock()
|
||||||
defer a.mtx.Unlock()
|
defer a.mtx.Unlock()
|
||||||
|
|
|
@ -130,16 +130,6 @@ func (pexR *PEXReactor) SendAddrs(peer *Peer, addrs []*NetAddress) {
|
||||||
peer.Send(PexChannel, struct{ PexMessage }{&pexAddrsMessage{Addrs: addrs}})
|
peer.Send(PexChannel, struct{ PexMessage }{&pexAddrsMessage{Addrs: addrs}})
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveAddrBook saves underlying address book
|
|
||||||
func (r *PEXReactor) SaveAddrBook() {
|
|
||||||
r.book.Save()
|
|
||||||
}
|
|
||||||
|
|
||||||
// AddPeerAddress adds raw NetAddress to the address book
|
|
||||||
func (r *PEXReactor) AddPeerAddress(peerAddr, srcAddr *NetAddress) {
|
|
||||||
r.book.AddAddress(peerAddr, srcAddr)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensures that sufficient peers are connected. (continuous)
|
// Ensures that sufficient peers are connected. (continuous)
|
||||||
func (pexR *PEXReactor) ensurePeersRoutine() {
|
func (pexR *PEXReactor) ensurePeersRoutine() {
|
||||||
// Randomize when routine starts
|
// Randomize when routine starts
|
||||||
|
|
Loading…
Reference in New Issue