Good for printing, and removes some code from peer_control. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
In future it will have TOR support, so the name will be awkward. We collect the to/fromwire functions in common/wireaddr.c, and the parsing functions in lightningd/netaddress.c. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Most of the code is from bitcoind, to handle the weird different non-public IP ranges. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>