Skip to content

Commit

Permalink
Fix upnp port forwarding bugs on some router
Browse files Browse the repository at this point in the history
Using upnp on some router do not allow requesting public ip from the router itslef
For metric polling, if node request itself, replace public ip by 127.0.0.1
  • Loading branch information
Neylix authored and samuelmanzanera committed Oct 4, 2022
1 parent f7b9873 commit b0c2008
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/archethic/metrics/poller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ defmodule Archethic.Metrics.Poller do
http_port: port,
first_public_key: first_public_key
} ->
{first_public_key, Collector.fetch_metrics(ip, port)}
if first_public_key == Archethic.Crypto.first_node_public_key(),
do: {first_public_key, Collector.fetch_metrics({127, 0, 0, 1}, port)},
else: {first_public_key, Collector.fetch_metrics(ip, port)}
end,
on_timeout: :kill_task
)
Expand Down

0 comments on commit b0c2008

Please sign in to comment.