Improve discovery

Workaround RS single local address flawed assumption by spreading
  all viables local addrresses via discovery
Spread addresses also through hidden node as they are the only hope
  to help direct connection happening for common trusted nodes
  behind nasty firewalls
This commit is contained in:
Gioacchino Mazzurco 2018-02-21 17:38:31 +01:00
parent 2044a2c848
commit 4fa6bdc789
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
2 changed files with 87 additions and 39 deletions

View file

@ -1024,17 +1024,6 @@ bool p3NetMgrIMPL::checkNetAddress()
std::vector<sockaddr_storage> addrs;
if (getLocalAddresses(addrs))
{
/* To work around one address limitation, to shuffle the list of
* local addresses in the hope that with enough time every local
* address is advertised to trusted nodes so they may try to
* connect to all of them including the most convenient if a local
* connection exists, is a bad idea. It would cause net reset every
* time a different local address is selected, potentially breaking
* broader RS assumptions.
*/
//std::random_shuffle(addrs.begin(), addrs.end());
for (auto it = addrs.begin(); it!=addrs.end(); ++it)
{
sockaddr_storage& addr(*it);