aboutsummaryrefslogtreecommitdiff
path: root/src/irc.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2012-05-13 15:06:16 +0200
committerPieter Wuille <[email protected]>2012-05-13 15:07:31 +0200
commit8f737d28a6a48070b5d3049fc183cf47c474fb0a (patch)
treead808c025b588c64f2e43c9a5fd180d549a94d4c /src/irc.cpp
parentMerge pull request #1285 from sipa/initerror (diff)
downloaddiscoin-8f737d28a6a48070b5d3049fc183cf47c474fb0a.tar.xz
discoin-8f737d28a6a48070b5d3049fc183cf47c474fb0a.zip
Only encode IPv4 addresses in IRC nicks
Diffstat (limited to 'src/irc.cpp')
-rw-r--r--src/irc.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/irc.cpp b/src/irc.cpp
index 525bd7a8d..4baffedb5 100644
--- a/src/irc.cpp
+++ b/src/irc.cpp
@@ -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());