2018-04-28 16:15:30 -04:00
|
|
|
package pex
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/tendermint/tendermint/p2p"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ErrAddrBookNonRoutable struct {
|
|
|
|
Addr *p2p.NetAddress
|
|
|
|
}
|
|
|
|
|
|
|
|
func (err ErrAddrBookNonRoutable) Error() string {
|
|
|
|
return fmt.Sprintf("Cannot add non-routable address %v", err.Addr)
|
|
|
|
}
|
|
|
|
|
|
|
|
type ErrAddrBookSelf struct {
|
|
|
|
Addr *p2p.NetAddress
|
|
|
|
}
|
|
|
|
|
|
|
|
func (err ErrAddrBookSelf) Error() string {
|
|
|
|
return fmt.Sprintf("Cannot add ourselves with address %v", err.Addr)
|
|
|
|
}
|
|
|
|
|
2018-07-18 02:22:09 -07:00
|
|
|
type ErrAddrBookPrivate struct {
|
|
|
|
Addr *p2p.NetAddress
|
|
|
|
}
|
|
|
|
|
|
|
|
func (err ErrAddrBookPrivate) Error() string {
|
|
|
|
return fmt.Sprintf("Cannot add private peer with address %v", err.Addr)
|
|
|
|
}
|
|
|
|
|
2018-04-28 16:15:30 -04:00
|
|
|
type ErrAddrBookNilAddr struct {
|
|
|
|
Addr *p2p.NetAddress
|
|
|
|
Src *p2p.NetAddress
|
|
|
|
}
|
|
|
|
|
|
|
|
func (err ErrAddrBookNilAddr) Error() string {
|
|
|
|
return fmt.Sprintf("Cannot add a nil address. Got (addr, src) = (%v, %v)", err.Addr, err.Src)
|
|
|
|
}
|