From 6db0ceaf81c305cb51f76d3ed36707cc0c850663 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Tue, 29 Sep 2015 10:25:03 -0700 Subject: [PATCH] Allow multiple connections from private IPs --- src/ripple/peerfinder/impl/Logic.h | 34 +----------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h index 440f3706e9..2c0fd77c48 100644 --- a/src/ripple/peerfinder/impl/Logic.h +++ b/src/ripple/peerfinder/impl/Logic.h @@ -285,6 +285,7 @@ public: typename SharedState::Access state (m_state); // Check for duplicate connection + if (is_public (remote_endpoint)) { auto const iter = state->connected_addresses.find ( remote_endpoint.address()); @@ -297,39 +298,6 @@ public: } } - // Check for self-connect by address - // This is disabled because otherwise we couldn't connect to - // ourselves for testing purposes. Eventually a self-connect will - // be dropped if the public key is the same. And if it's different, - // we want to allow the self-connect. - /* - { - auto const iter (state->slots.find (local_endpoint)); - if (iter != state->slots.end ()) - { - Slot::ptr const& self (iter->second); - bool const consistent (( - self->local_endpoint() == boost::none) || - (*self->local_endpoint() == remote_endpoint)); - if (! consistent) - { - m_journal.fatal << "\n" << - "Local endpoint mismatch\n" << - "local_endpoint=" << local_endpoint << - ", remote_endpoint=" << remote_endpoint << "\n" << - "self->local_endpoint()=" << *self->local_endpoint() << - ", self->remote_endpoint()=" << self->remote_endpoint(); - } - // This assert goes off - //assert (consistent); - if (m_journal.warning) m_journal.warning << beast::leftw (18) << - "Logic dropping " << remote_endpoint << - " as self connect"; - return SlotImp::ptr (); - } - } - */ - // Create the slot SlotImp::ptr const slot (std::make_shared (local_endpoint, remote_endpoint, fixed (remote_endpoint.address (), state),