aboutsummaryrefslogtreecommitdiff
path: root/src/irc.cpp
diff options
context:
space:
mode:
authorJeff Garzik <[email protected]>2012-05-13 11:48:27 -0700
committerJeff Garzik <[email protected]>2012-05-13 11:48:27 -0700
commit28d257da11cde2e9ff1ccf5fbec0b23cfecb2a49 (patch)
tree37bca19ef253b053d63dd85f3f7b6378769d4311 /src/irc.cpp
parentrelease-process.txt: Add a note to check the download link destinations. (diff)
parentOnly encode IPv4 addresses in IRC nicks (diff)
downloaddiscoin-28d257da11cde2e9ff1ccf5fbec0b23cfecb2a49.tar.xz
discoin-28d257da11cde2e9ff1ccf5fbec0b23cfecb2a49.zip
Merge pull request #1287 from sipa/noirc6
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());