Make NetworkOPs accept ServiceRegistry

This commit is contained in:
JCW
2026-01-08 20:00:43 +00:00
parent 0cc6cc74e2
commit cf4832d7e0
5 changed files with 11 additions and 9 deletions

View File

@@ -383,7 +383,7 @@ public:
logs_->journal("TaggedCache"))
, m_networkOPs(make_NetworkOPs(
*this,
getServiceRegistry(),
stopwatch(),
config_->standalone(),
config_->NETWORK_QUORUM,

View File

@@ -206,7 +206,7 @@ class NetworkOPsImp final : public NetworkOPs
public:
NetworkOPsImp(
Application& app,
ServiceRegistry& registry,
NetworkOPs::clock_type& clock,
bool standalone,
std::size_t minPeerCount,
@@ -217,7 +217,7 @@ public:
boost::asio::io_context& io_svc,
beast::Journal journal,
beast::insight::Collector::ptr const& collector)
: app_(app)
: app_(registry.app())
, m_journal(journal)
, m_localTX(make_LocalTxs())
, mMode(start_valid ? OperatingMode::FULL : OperatingMode::DISCONNECTED)
@@ -225,13 +225,13 @@ public:
, clusterTimer_(io_svc)
, accountHistoryTxTimer_(io_svc)
, mConsensus(
app,
app_,
make_FeeVote(
setup_FeeVote(app_.config().section("voting")),
app_.logs().journal("FeeVote")),
ledgerMaster,
*m_localTX,
app.getInboundTransactions(),
registry.getInboundTransactions(),
beast::get_abstract_clock<std::chrono::steady_clock>(),
validatorKeys,
app_.logs().journal("LedgerConsensus"))
@@ -4867,7 +4867,7 @@ NetworkOPsImp::StateAccounting::json(Json::Value& obj) const
std::unique_ptr<NetworkOPs>
make_NetworkOPs(
Application& app,
ServiceRegistry& registry,
NetworkOPs::clock_type& clock,
bool standalone,
std::size_t minPeerCount,
@@ -4880,7 +4880,7 @@ make_NetworkOPs(
beast::insight::Collector::ptr const& collector)
{
return std::make_unique<NetworkOPsImp>(
app,
registry,
clock,
standalone,
minPeerCount,

View File

@@ -2,9 +2,9 @@
#define XRPL_APP_MISC_NETWORKOPS_H_INCLUDED
#include <xrpld/app/consensus/RCLCxPeerPos.h>
#include <xrpld/app/ledger/Ledger.h>
#include <xrpl/core/JobQueue.h>
#include <xrpl/core/ServiceRegistry.h>
#include <xrpl/ledger/ReadView.h>
#include <xrpl/protocol/STValidation.h>
#include <xrpl/protocol/TER.h>
@@ -265,7 +265,7 @@ public:
std::unique_ptr<NetworkOPs>
make_NetworkOPs(
Application& app,
ServiceRegistry& registry,
NetworkOPs::clock_type& clock,
bool standalone,
std::size_t minPeerCount,

View File

@@ -1,6 +1,7 @@
#ifndef XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED
#define XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED
#include <xrpld/app/ledger/Ledger.h>
#include <xrpld/app/misc/NetworkOPs.h>
#include <xrpld/app/misc/TxQ.h>
#include <xrpld/rpc/Context.h>