1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 12:24:19 +00:00

don't insert same address twice

This commit is contained in:
orignal 2016-03-22 07:30:16 -04:00
parent 37c450f1e1
commit 9692c34f6c

View File

@ -552,7 +552,7 @@ namespace data
addr->date = 0; addr->date = 0;
addr->mtu = 0; addr->mtu = 0;
for (auto it: m_Addresses) // don't insert same address twice for (auto it: m_Addresses) // don't insert same address twice
if (it == addr) return; if (*it == *addr) return;
m_Addresses.push_back(addr); m_Addresses.push_back(addr);
m_SupportedTransports |= addr->host.is_v6 () ? eNTCPV6 : eNTCPV4; m_SupportedTransports |= addr->host.is_v6 () ? eNTCPV6 : eNTCPV4;
} }
@ -568,7 +568,7 @@ namespace data
addr->mtu = mtu; addr->mtu = mtu;
memcpy (addr->key, key, 32); memcpy (addr->key, key, 32);
for (auto it: m_Addresses) // don't insert same address twice for (auto it: m_Addresses) // don't insert same address twice
if (it == addr) return; if (*it == *addr) return;
m_Addresses.push_back(addr); m_Addresses.push_back(addr);
m_SupportedTransports |= addr->host.is_v6 () ? eSSUV6 : eSSUV4; m_SupportedTransports |= addr->host.is_v6 () ? eSSUV6 : eSSUV4;
m_Caps |= eSSUTesting; m_Caps |= eSSUTesting;