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

Commit

Permalink
Try to prevent stungunning relayed peers
Browse files Browse the repository at this point in the history
  • Loading branch information
mawdegroot committed Apr 20, 2022
1 parent 451688b commit 2d6410e
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 2d6410e

Please sign in to comment.