Determine the "best" local address for a particular peer. If none, return the unroutable 0.0.0.0 but filled in with the normal parameters, since the IP may be changed to a useful one by discovery.
| 219 | // the normal parameters, since the IP may be changed to a useful |
| 220 | // one by discovery. |
| 221 | CService GetLocalAddress(const CNode& peer) |
| 222 | { |
| 223 | return GetLocal(peer).value_or(CService{CNetAddr(), GetListenPort()}); |
| 224 | } |
| 225 | |
| 226 | static int GetnScore(const CService& addr) |
| 227 | { |