perlin-network / noise

A decentralized P2P networking stack written in Go.
https://godoc.org/github.com/perlin-network/noise
MIT License
1.79k stars 211 forks source link

Simplify addr.go logic when resolving IP #294

Closed emad-elsaid closed 3 years ago

emad-elsaid commented 3 years ago

I was reading the project source code and found that addr.go functions can be more readable.

The function resolveIP what it was really doing is rejecting the IP in certain cases so it's ought to check the IP and return boolean in case it's not a valid IP. so I rewrote it to do so and then changed the usage. that simplified the other two functions ResolveAddress and normalizeIP

emad-elsaid commented 3 years ago

ok, it's been months so I'll assume the PR won't move forward. I'll close it and leave the branch in case we need to get back to it later again.