diff --git a/src/ripple/app/misc/impl/Manifest.cpp b/src/ripple/app/misc/impl/Manifest.cpp index 44e19244a..ea2a80e8d 100644 --- a/src/ripple/app/misc/impl/Manifest.cpp +++ b/src/ripple/app/misc/impl/Manifest.cpp @@ -471,6 +471,10 @@ ManifestCache::applyManifest(Manifest m) auto masterKey = m.masterKey; map_.emplace(std::move(masterKey), std::move(m)); + + // Increment sequence to invalidate cached manifest messages + seq_++; + return ManifestDisposition::accepted; } diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index b1027826f..d5a0b952a 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -484,44 +484,61 @@ OverlayImpl::start() m_peerFinder->setConfig(config); m_peerFinder->start(); - auto addIps = [&](std::vector bootstrapIps) -> void { + auto addIps = [this](std::vector ips, bool fixed) { beast::Journal const& j = app_.journal("Overlay"); - for (auto& ip : bootstrapIps) + for (auto& ip : ips) { std::size_t pos = ip.find('#'); if (pos != std::string::npos) ip.erase(pos); - JLOG(j.trace()) << "Found boostrap IP: " << ip; + JLOG(j.trace()) + << "Found " << (fixed ? "fixed" : "bootstrap") << " IP: " << ip; } m_resolver.resolve( - bootstrapIps, - [&](std::string const& name, + ips, + [this, fixed]( + std::string const& name, std::vector const& addresses) { - std::vector ips; - ips.reserve(addresses.size()); beast::Journal const& j = app_.journal("Overlay"); + std::string const base("config: "); + + std::vector eps; + eps.reserve(addresses.size()); for (auto const& addr : addresses) { - std::string addrStr = addr.port() == 0 - ? to_string(addr.at_port(DEFAULT_PEER_PORT)) - : to_string(addr); - JLOG(j.trace()) << "Parsed boostrap IP: " << addrStr; - ips.push_back(addrStr); + auto ep = addr.port() == 0 ? addr.at_port(DEFAULT_PEER_PORT) + : addr; + JLOG(j.trace()) + << "Parsed " << (fixed ? "fixed" : "bootstrap") + << " IP: " << ep; + eps.push_back(ep); } - std::string const base("config: "); - if (!ips.empty()) - m_peerFinder->addFallbackStrings(base + name, ips); + if (eps.empty()) + return; + + if (fixed) + { + m_peerFinder->addFixedPeer(base + name, eps); + } + else + { + std::vector strs; + strs.reserve(eps.size()); + for (auto const& ep : eps) + strs.push_back(to_string(ep)); + m_peerFinder->addFallbackStrings(base + name, strs); + } }); }; if (!app_.config().IPS.empty()) - addIps(app_.config().IPS); + addIps(app_.config().IPS, false); if (!app_.config().IPS_FIXED.empty()) - addIps(app_.config().IPS_FIXED); + addIps(app_.config().IPS_FIXED, true); auto const timer = std::make_shared(*this); std::lock_guard lock(mutex_);