Use remote address from opened socket instead of the claimed IP in peer list
Created by: dNetGuru
Currently siac gateway list
shows the claimed IP address sent in a sessionHeader. There are two main issues with this approach.
Since as it stands the local interface IP is sent in the sessionHeader (instead of the external IP) we end up with invalid IP addresses shown for inbound connections when we execute siac gateway list
that don't correspond to actual open sockets in the system. This makes correlating outputs from network monitoring utilities like netstat
and the likes with the output from siac
impractical.
Example output from siac gateway list
root@siad-dev:/home/siad-dev/Sia/gateway# siac gateway list | grep No | head -n 5
1.3.0 No 192.168.70.246:9981
1.3.0 No 192.168.0.20:9981
1.3.0 No 192.168.0.114:9981
1.3.0 No 192.168.199.225:9981
1.3.0 No 192.168.1.21:9981
Second, we are blindly trusting the remote party not to lie about their network address which will be shown in the peer list (since network check was removed in #2254).