diff --git a/src/ripple/overlay/impl/ConnectAttempt.cpp b/src/ripple/overlay/impl/ConnectAttempt.cpp index 845677aed..9d9c17b65 100644 --- a/src/ripple/overlay/impl/ConnectAttempt.cpp +++ b/src/ripple/overlay/impl/ConnectAttempt.cpp @@ -51,7 +51,7 @@ ConnectAttempt::ConnectAttempt (boost::asio::io_service& io_service, , response_, false) , slot_ (slot) { - if (journal_.trace) journal_.trace << + if (journal_.debug) journal_.debug << "Connect " << remote_endpoint; } diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h index 6cb2b0591..a4c90d3b1 100644 --- a/src/ripple/peerfinder/impl/Logic.h +++ b/src/ripple/peerfinder/impl/Logic.h @@ -485,6 +485,9 @@ public: /** Create new outbound connection attempts as needed. This implements PeerFinder's "Outbound Connection Strategy" */ + // VFALCO TODO This should add the returned addresses to the + // squelch list in one go once the list is built, + // rather than having each module add to the squelch list. std::vector autoconnect() { @@ -510,7 +513,7 @@ public: // if (state->counts.fixed_active() < state->fixed.size ()) { - get_fixed (needed, h.list(), state); + get_fixed (needed, h.list(), m_squelches, state); if (! h.list().empty ()) { @@ -964,6 +967,7 @@ public: /** Adds eligible Fixed addresses for outbound attempts. */ template void get_fixed (std::size_t needed, Container& c, + typename ConnectHandouts::Squelches& squelches, typename SharedState::Access& state) { auto const now (m_clock.now()); @@ -971,13 +975,15 @@ public: needed && iter != state->fixed.end (); ++iter) { auto const& address (iter->first.address()); - if (iter->second.when() <= now && std::none_of ( - state->slots.cbegin(), state->slots.cend(), + if (iter->second.when() <= now && squelches.find(address) == + squelches.end() && std::none_of ( + state->slots.cbegin(), state->slots.cend(), [address](Slots::value_type const& v) { return address == v.first.address(); })) { + squelches.insert(iter->first.address()); c.push_back (iter->first); --needed; }