Skip to content

Commit

Permalink
cleanup: add continue in case of failure in the (*BasicHost).Addrs ce…
Browse files Browse the repository at this point in the history
…rthash loop (#2492)

This does not do change anything because the transport always returns the same multiaddr you passed in in case of failure, it just looks wrong and relies on a obscure detail of the webtransport's AddCertHashes function, while this does not.
  • Loading branch information
Jorropo authored Aug 16, 2023
1 parent 676a35f commit 2398ba4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,11 @@ func (h *BasicHost) Addrs() []ma.Multiaddr {
continue
}
addrWithCerthash, added := tpt.AddCertHashes(addr)
addrs[i] = addrWithCerthash
if !added {
log.Debug("Couldn't add certhashes to webtransport multiaddr because we aren't listening on webtransport")
continue
}
addrs[i] = addrWithCerthash
}
}
return addrs
Expand Down

0 comments on commit 2398ba4

Please sign in to comment.