You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
834 B

  1. package pex
  2. import (
  3. "fmt"
  4. "github.com/tendermint/tendermint/p2p"
  5. )
  6. type ErrAddrBookNonRoutable struct {
  7. Addr *p2p.NetAddress
  8. }
  9. func (err ErrAddrBookNonRoutable) Error() string {
  10. return fmt.Sprintf("Cannot add non-routable address %v", err.Addr)
  11. }
  12. type ErrAddrBookSelf struct {
  13. Addr *p2p.NetAddress
  14. }
  15. func (err ErrAddrBookSelf) Error() string {
  16. return fmt.Sprintf("Cannot add ourselves with address %v", err.Addr)
  17. }
  18. type ErrAddrBookPrivate struct {
  19. Addr *p2p.NetAddress
  20. }
  21. func (err ErrAddrBookPrivate) Error() string {
  22. return fmt.Sprintf("Cannot add private peer with address %v", err.Addr)
  23. }
  24. type ErrAddrBookNilAddr struct {
  25. Addr *p2p.NetAddress
  26. Src *p2p.NetAddress
  27. }
  28. func (err ErrAddrBookNilAddr) Error() string {
  29. return fmt.Sprintf("Cannot add a nil address. Got (addr, src) = (%v, %v)", err.Addr, err.Src)
  30. }