Allow multiple connections from private IPs

This commit is contained in:
Nik Bougalis
2015-09-29 10:25:03 -07:00
committed by Vinnie Falco
parent 6f81d2e45d
commit 6db0ceaf81

View File

@@ -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 <SlotImp> (local_endpoint,
remote_endpoint, fixed (remote_endpoint.address (), state),