get best local address for a particular peer as a CAddress Otherwise, 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.
| 206 | // the normal parameters, since the IP may be changed to a useful |
| 207 | // one by discovery. |
| 208 | CAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices) |
| 209 | { |
| 210 | CAddress ret(CService(CNetAddr(),GetListenPort()), nLocalServices); |
| 211 | CService addr; |
| 212 | if (GetLocal(addr, paddrPeer)) |
| 213 | { |
| 214 | ret = CAddress(addr, nLocalServices); |
| 215 | } |
| 216 | ret.nTime = GetAdjustedTime(); |
| 217 | return ret; |
| 218 | } |
| 219 | |
| 220 | static int GetnScore(const CService& addr) |
| 221 | { |
no test coverage detected