From d90ba775e839e290143c6d585597455b142a2baf Mon Sep 17 00:00:00 2001 From: Miguel Portilla Date: Wed, 20 May 2015 13:13:15 -0400 Subject: [PATCH] Require port in ips_fixed (RIPD-892) --- doc/rippled-example.cfg | 4 ++-- src/ripple/peerfinder/impl/Logic.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/rippled-example.cfg b/doc/rippled-example.cfg index 9f1eaee217..97a6bc61f4 100644 --- a/doc/rippled-example.cfg +++ b/doc/rippled-example.cfg @@ -303,8 +303,8 @@ # Ripple network through a public-facing server, or for building a set # of cluster peers. # -# One IPv4 address or domain names per line is allowed. A port may optionally -# be specified after adding a space to the address. +# One IPv4 address or domain names per line is allowed. A port must be +# specified after adding a space to the address. # # # diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h index a07ff7e85b..e3eac66203 100644 --- a/src/ripple/peerfinder/impl/Logic.h +++ b/src/ripple/peerfinder/impl/Logic.h @@ -211,6 +211,12 @@ public: for (auto const& remote_address : addresses) { + if (remote_address.port () == 0) + { + throw std::runtime_error ("Port not specified for address:" + + remote_address.to_string ()); + } + auto result (state->fixed.emplace (std::piecewise_construct, std::forward_as_tuple (remote_address), std::make_tuple (std::ref (m_clock))));