Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Try to prevent stungunning relayed peers #432

Merged
merged 1 commit into from
Jun 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libp2p_transport_tcp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ handle_info(stungun_retry, State=#state{observed_addrs=Addrs, tid=TID, stun_txns
{PeerPath, TxnID} = libp2p_stream_stungun:mk_stun_txn(),
%% choose a random connected peer to do stungun with
{ok, MyPeer} = libp2p_peerbook:get(libp2p_swarm:peerbook(TID), libp2p_swarm:pubkey_bin(TID)),
case [libp2p_crypto:pubkey_bin_to_p2p(P) || P <- libp2p_peer:connected_peers(MyPeer)] of
case [libp2p_crypto:pubkey_bin_to_p2p(P) || P <- libp2p_peer:connected_peers(MyPeer), libp2p_peer:has_public_ip(P)] of
[] ->
%% no connected peers
Ref = erlang:send_after(30000, self(), stungun_retry),
Expand Down