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