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.

20 lines
404 B

  1. package p2p
  2. import (
  3. "errors"
  4. "fmt"
  5. )
  6. var (
  7. ErrSwitchDuplicatePeer = errors.New("Duplicate peer")
  8. ErrSwitchConnectToSelf = errors.New("Connect to self")
  9. )
  10. type ErrSwitchAuthenticationFailure struct {
  11. Dialed *NetAddress
  12. Got ID
  13. }
  14. func (e ErrSwitchAuthenticationFailure) Error() string {
  15. return fmt.Sprintf("Failed to authenticate peer. Dialed %v, but got peer with ID %s", e.Dialed, e.Got)
  16. }