Skip to content

Commit

Permalink
differentiate between dial back error and dial error
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Aug 27, 2023
1 parent 367cbe1 commit d4187ef
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 326 deletions.
6 changes: 4 additions & 2 deletions p2p/protocol/autonatv2/autonat.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ type Result struct {
Status pb.DialStatus
}

// AutoNAT implements the AutoNAT v2 client and server. Users can check reachability
// for their addresses using the CheckReachability method.
// AutoNAT implements the AutoNAT v2 client and server.
// Users can check reachability for their addresses using the CheckReachability method.
// The server provides amplification attack prevention and rate limiting.
type AutoNAT struct {
host host.Host
sub event.Subscription
Expand Down Expand Up @@ -140,6 +141,7 @@ func (an *AutoNAT) background() {
select {
case <-an.ctx.Done():
an.srv.Disable()
an.srv.Close()
an.peers = nil
an.wg.Done()
return
Expand Down

0 comments on commit d4187ef

Please sign in to comment.