Skip to content

Commit

Permalink
Fix a code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Sep 15, 2022
1 parent d331b4a commit 0090b1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/net/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2098,9 +2098,10 @@ namespace graphene { namespace net { namespace detail {
{
// Our best guess for the peer's inbound endpoint now is its remote endpoint,
// unless we are behind a reverse proxy, in which case we try to use a public address
if( originating_peer->get_remote_endpoint()->get_address().is_public_address()
auto remote_endpoint = originating_peer->get_remote_endpoint(); // Note: this returns a copy
if( remote_endpoint->get_address().is_public_address()
|| !originating_peer->get_endpoint_for_connecting()->get_address().is_public_address() )
originating_peer->remote_inbound_endpoint = originating_peer->get_remote_endpoint();
originating_peer->remote_inbound_endpoint = remote_endpoint;
// else do nothing

// We could reinitialize inbound endpoint verification here, but it doesn't seem necessary
Expand Down

0 comments on commit 0090b1f

Please sign in to comment.