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.
| 149 | // the normal parameters, since the IP may be changed to a useful |
| 150 | // one by discovery. |
| 151 | CAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices) |
| 152 | { |
| 153 | CAddress ret(CService(CNetAddr(),GetListenPort()), nLocalServices); |
| 154 | CService addr; |
| 155 | if (GetLocal(addr, paddrPeer)) |
| 156 | { |
| 157 | ret = CAddress(addr, nLocalServices); |
| 158 | } |
| 159 | ret.nTime = GetAdjustedTime(); |
| 160 | return ret; |
| 161 | } |
| 162 | |
| 163 | static int GetnScore(const CService& addr) |
| 164 | { |
no test coverage detected