diff --git a/doc/rippled-example.cfg b/doc/rippled-example.cfg index 97a6bc61f..116055434 100644 --- a/doc/rippled-example.cfg +++ b/doc/rippled-example.cfg @@ -279,8 +279,8 @@ # list, you can either copy entries from: https://ripple.com/ripple.txt or if # you prefer you can specify r.ripple.com 51235 # -# One IPv4 address or domain names per line is allowed. A port may optionally -# be specified after adding a space to the address. By convention, if known, +# One IPv4 address or domain names per line is allowed. A port may must be +# specified after adding a space to the address. By convention, if known, # IPs are listed in from most to least trusted. # # Examples: diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index fe1950448..37d7b555e 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -245,7 +245,7 @@ OverlayImpl::onHandoff (std::unique_ptr && ssl_bundle, std::string name; bool const cluster = getApp().getUNL().nodeInCluster( publicKey, name); - + auto const result = m_peerFinder->activate (slot, publicKey.toPublicKey(), cluster); if (result != PeerFinder::Result::success) @@ -338,7 +338,7 @@ OverlayImpl::connect (beast::IP::Endpoint const& remote_endpoint) "Over resource limit: " << remote_endpoint; return; } - + auto const slot = peerFinder().new_outbound_slot(remote_endpoint); if (slot == nullptr) { @@ -460,21 +460,27 @@ OverlayImpl::onPrepare() if (bootstrapIps.empty ()) bootstrapIps.push_back ("r.ripple.com 51235"); - if (!bootstrapIps.empty ()) - { - m_resolver.resolve (bootstrapIps, - [this](std::string const& name, - std::vector const& addresses) + m_resolver.resolve (bootstrapIps, + [this](std::string const& name, + std::vector const& addresses) + { + std::vector ips; + ips.reserve(addresses.size()); + for (auto const& addr : addresses) { - std::vector ips; - ips.reserve(addresses.size()); - for (auto const& addr : addresses) - ips.push_back (to_string (addr)); - std::string const base ("config: "); - if (!ips.empty ()) - m_peerFinder->addFallbackStrings (base + name, ips); - }); - } + if (addr.port () == 0) + { + throw std::runtime_error ("Port not specified for " + "address:" + addr.to_string ()); + } + + ips.push_back (to_string (addr)); + } + + std::string const base ("config: "); + if (!ips.empty ()) + m_peerFinder->addFallbackStrings (base + name, ips); + }); // Add the ips_fixed from the rippled.cfg file if (! getConfig ().RUN_STANDALONE && !getConfig ().IPS_FIXED.empty ())