Browse Source

Merge pull request #1287 from sipa/noirc6

Only encode IPv4 addresses in IRC nicks
0.8
Jeff Garzik 13 years ago
parent
commit
28d257da11
  1. 5
      src/irc.cpp

5
src/irc.cpp

@ -246,11 +246,12 @@ void ThreadIRCSeed2(void* parg) @@ -246,11 +246,12 @@ void ThreadIRCSeed2(void* parg)
return;
}
CNetAddr addrIPv4("1.2.3.4"); // arbitrary IPv4 address to make GetLocal prefer IPv4 addresses
CService addrLocal;
string strMyName;
if (GetLocal(addrLocal, &addrConnect))
if (GetLocal(addrLocal, &addrIPv4))
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
else
if (strMyName == "")
strMyName = strprintf("x%u", GetRand(1000000000));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());

Loading…
Cancel
Save