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.
| 181 | // the normal parameters, since the IP may be changed to a useful |
| 182 | // one by discovery. |
| 183 | CAddress GetLocalAddress(const CNetAddr *paddrPeer) |
| 184 | { |
| 185 | CAddress ret(CService("0.0.0.0",GetListenPort()),0); |
| 186 | CService addr; |
| 187 | if (GetLocal(addr, paddrPeer)) |
| 188 | { |
| 189 | ret = CAddress(addr); |
| 190 | } |
| 191 | ret.nServices = nLocalServices; |
| 192 | ret.nTime = GetAdjustedTime(); |
| 193 | return ret; |
| 194 | } |
| 195 | |
| 196 | int GetnScore(const CService& addr) |
| 197 | { |
no test coverage detected