Skip to content

Commit

Permalink
Merge pull request #1088 from libp2p/feat/expose-autonat
Browse files Browse the repository at this point in the history
fix: re-expose AutoNAT service on BasicHost
  • Loading branch information
Stebalien authored May 5, 2021
2 parents a8e8215 + e482b45 commit 3e5c305
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,13 @@ func (h *BasicHost) SetAutoNat(a autonat.AutoNAT) {
}
}

// Return the host's AutoNAT service, if AutoNAT is enabled.
func (h *BasicHost) GetAutoNat() autonat.AutoNAT {
h.addrMu.Lock()
defer h.addrMu.Unlock()
return h.autoNat
}

// Close shuts down the Host's services (network, etc).
func (h *BasicHost) Close() error {
h.closeSync.Do(func() {
Expand Down

0 comments on commit 3e5c305

Please sign in to comment.