mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-11 15:48:05 +00:00
Merge pull request #1287 from sipa/noirc6
Only encode IPv4 addresses in IRC nicks
This commit is contained in:
commit
28d257da11
@ -246,11 +246,12 @@ void ThreadIRCSeed2(void* parg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CNetAddr addrIPv4("1.2.3.4"); // arbitrary IPv4 address to make GetLocal prefer IPv4 addresses
|
||||||
CService addrLocal;
|
CService addrLocal;
|
||||||
string strMyName;
|
string strMyName;
|
||||||
if (GetLocal(addrLocal, &addrConnect))
|
if (GetLocal(addrLocal, &addrIPv4))
|
||||||
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
|
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
|
||||||
else
|
if (strMyName == "")
|
||||||
strMyName = strprintf("x%u", GetRand(1000000000));
|
strMyName = strprintf("x%u", GetRand(1000000000));
|
||||||
|
|
||||||
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
|
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user