NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 442 forks source link

Deduplicate host and gateway IP discovery code #3130

Closed ChrisSchinnerl closed 5 years ago

ChrisSchinnerl commented 6 years ago

It looks like we currently have almost the same IP discovery code in the host and gateway, except that the gateway now has a decentralized way to do it. We might be able to simply put the gateway IP discovery code into a publicIP method and have an exported PublicIP method that gets called by the host instead of using it's own code.

After that is done a good followup PR might be to also deduplicate the UPnP code of the host.