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

Commit

Permalink
Merge pull request #432 from mawdegroot/mg/fix-unintentional-relay
Browse files Browse the repository at this point in the history
Try to prevent stungunning relayed peers
  • Loading branch information
jadeallenx authored Jun 17, 2022
2 parents 9187236 + 2d6410e commit 7a09441
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 7a09441

Please sign in to comment.