From e46d2bcf276368e5751003351d4e9ccddd232eaa Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Thu, 14 Jul 2022 16:37:11 -0700 Subject: [PATCH] Correctly use the configured `network_id` parameter: The existing code properly parses the network_id parameter from the the configuration file, but it does not properly set up the code to use the value correctly. As a result the configured `network_id` is ignored. --- src/ripple/app/misc/NetworkOPs.cpp | 7 +++---- src/ripple/overlay/impl/OverlayImpl.h | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 6ff644ba8..bdc266422 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -2323,10 +2323,6 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) if (!app_.config().SERVER_DOMAIN.empty()) info[jss::server_domain] = app_.config().SERVER_DOMAIN; - if (!app_.config().reporting()) - if (auto const netid = app_.overlay().networkID()) - info[jss::network_id] = static_cast(*netid); - info[jss::build_version] = BuildInfo::getVersionString(); info[jss::server_state] = strOperatingMode(admin); @@ -2469,6 +2465,9 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) if (!app_.config().reporting()) { + if (auto const netid = app_.overlay().networkID()) + info[jss::network_id] = static_cast(*netid); + auto const escalationMetrics = app_.getTxQ().getMetrics(*app_.openLedger().current()); diff --git a/src/ripple/overlay/impl/OverlayImpl.h b/src/ripple/overlay/impl/OverlayImpl.h index 5f23b9150..2ba7999cb 100644 --- a/src/ripple/overlay/impl/OverlayImpl.h +++ b/src/ripple/overlay/impl/OverlayImpl.h @@ -125,8 +125,6 @@ private: // Peer IDs expecting to receive a last link notification std::set csIDs_; - std::optional networkID_; - reduce_relay::Slots slots_; // Transaction reduce-relay metrics @@ -391,7 +389,7 @@ public: std::optional networkID() const override { - return networkID_; + return setup_.networkID; } Json::Value