diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-05-31 13:05:52 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2016-07-31 13:24:07 -0400 |
commit | 31d6b1d5f0414d8b356d8cb9c99961d8a04d6c0a (patch) | |
tree | e1044a96d479c66c639528276d54f674b5103ae8 /src/net.cpp | |
parent | 6caf3ee061a86d89b965dc8a61a95d1f34015805 (diff) |
net: Split resolving out of CNetAddr
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index 4cbc43e4d8..8725346fe8 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1396,8 +1396,11 @@ void ThreadMapPort() { if(externalIPAddress[0]) { - LogPrintf("UPnP: ExternalIPAddress = %s\n", externalIPAddress); - AddLocal(CNetAddr(externalIPAddress), LOCAL_UPNP); + CNetAddr resolved; + if(LookupHost(externalIPAddress, resolved, false)) { + LogPrintf("UPnP: ExternalIPAddress = %s\n", resolved.ToString().c_str()); + AddLocal(resolved, LOCAL_UPNP); + } } else LogPrintf("UPnP: GetExternalIPAddress failed.\n"); @@ -1623,7 +1626,9 @@ void ThreadOpenConnections() static bool done = false; if (!done) { LogPrintf("Adding fixed seed nodes as DNS doesn't seem to be available.\n"); - addrman.Add(convertSeed6(Params().FixedSeeds()), CNetAddr("127.0.0.1")); + CNetAddr local; + LookupHost("127.0.0.1", local, false); + addrman.Add(convertSeed6(Params().FixedSeeds()), local); done = true; } } |