mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-06 18:26:51 +00:00
Remove dead code
This commit is contained in:
committed by
manojsdoshi
parent
a2a37a928a
commit
14b2f27c3e
@@ -54,15 +54,4 @@ AcceptedLedger::insert(AcceptedLedgerTx::ref at)
|
||||
mMap.insert(std::make_pair(at->getIndex(), at));
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::pointer
|
||||
AcceptedLedger::getTxn(int i) const
|
||||
{
|
||||
map_t::const_iterator it = mMap.find(i);
|
||||
|
||||
if (it == mMap.end())
|
||||
return AcceptedLedgerTx::pointer();
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -69,9 +69,6 @@ public:
|
||||
return mMap.size();
|
||||
}
|
||||
|
||||
AcceptedLedgerTx::pointer
|
||||
getTxn(int) const;
|
||||
|
||||
AcceptedLedger(
|
||||
std::shared_ptr<ReadView const> const& ledger,
|
||||
Application& app);
|
||||
|
||||
@@ -70,10 +70,6 @@ public:
|
||||
class LedgerMaster : public AbstractFetchPackContainer
|
||||
{
|
||||
public:
|
||||
// Age for last validated ledger if the process has yet to validate.
|
||||
static constexpr std::chrono::seconds NO_VALIDATED_LEDGER_AGE =
|
||||
std::chrono::hours{24 * 14};
|
||||
|
||||
explicit LedgerMaster(
|
||||
Application& app,
|
||||
Stopwatch& stopwatch,
|
||||
@@ -240,8 +236,6 @@ public:
|
||||
uint256 const& consensusHash,
|
||||
Json::Value consensus);
|
||||
|
||||
LedgerIndex
|
||||
getBuildingLedger();
|
||||
void
|
||||
setBuildingLedger(LedgerIndex index);
|
||||
|
||||
|
||||
@@ -129,12 +129,6 @@ public:
|
||||
bool
|
||||
finished() const;
|
||||
|
||||
static char const*
|
||||
getCountedObjectName()
|
||||
{
|
||||
return "LedgerReplayTask";
|
||||
}
|
||||
|
||||
private:
|
||||
void
|
||||
onTimer(bool progress, ScopedLockType& sl) override;
|
||||
|
||||
@@ -111,12 +111,6 @@ public:
|
||||
void
|
||||
addDataCallback(InboundLedger::Reason reason, OnDeltaDataCB&& cb);
|
||||
|
||||
static char const*
|
||||
getCountedObjectName()
|
||||
{
|
||||
return "LedgerDeltaAcquire";
|
||||
}
|
||||
|
||||
private:
|
||||
void
|
||||
onTimer(bool progress, ScopedLockType& peerSetLock) override;
|
||||
|
||||
@@ -580,13 +580,6 @@ LedgerMaster::popAcctTransaction(std::shared_ptr<STTx const> const& tx)
|
||||
return mHeldTransactions.popAcctTransaction(tx);
|
||||
}
|
||||
|
||||
LedgerIndex
|
||||
LedgerMaster::getBuildingLedger()
|
||||
{
|
||||
// The ledger we are currently building, 0 of none
|
||||
return mBuildingLedgerSeq.load();
|
||||
}
|
||||
|
||||
void
|
||||
LedgerMaster::setBuildingLedger(LedgerIndex i)
|
||||
{
|
||||
|
||||
@@ -109,12 +109,6 @@ public:
|
||||
std::shared_ptr<SkipListData const>
|
||||
getData() const;
|
||||
|
||||
static char const*
|
||||
getCountedObjectName()
|
||||
{
|
||||
return "SkipListAcquire";
|
||||
}
|
||||
|
||||
private:
|
||||
void
|
||||
onTimer(bool progress, ScopedLockType& peerSetLock) override;
|
||||
|
||||
@@ -142,8 +142,6 @@ class NetworkOPsImp final : public NetworkOPs
|
||||
std::chrono::system_clock::time_point start_ =
|
||||
std::chrono::system_clock::now();
|
||||
static std::array<Json::StaticString const, 5> const states_;
|
||||
static Json::StaticString const transitions_;
|
||||
static Json::StaticString const dur_;
|
||||
|
||||
public:
|
||||
explicit StateAccounting()
|
||||
@@ -229,7 +227,6 @@ public:
|
||||
beast::Journal journal,
|
||||
beast::insight::Collector::ptr const& collector)
|
||||
: app_(app)
|
||||
, m_clock(clock)
|
||||
, m_journal(journal)
|
||||
, m_localTX(make_LocalTxs())
|
||||
, mMode(start_valid ? OperatingMode::FULL : OperatingMode::DISCONNECTED)
|
||||
@@ -362,14 +359,6 @@ public:
|
||||
std::shared_ptr<STValidation> const& val,
|
||||
std::string const& source) override;
|
||||
|
||||
std::shared_ptr<SHAMap>
|
||||
getTXMap(uint256 const& hash);
|
||||
bool
|
||||
hasTXSet(
|
||||
const std::shared_ptr<Peer>& peer,
|
||||
uint256 const& set,
|
||||
protocol::TxSetStatus status);
|
||||
|
||||
void
|
||||
mapComplete(std::shared_ptr<SHAMap> const& map, bool fromAcquire) override;
|
||||
|
||||
@@ -440,8 +429,6 @@ public:
|
||||
std::uint32_t
|
||||
acceptLedger(
|
||||
std::optional<std::chrono::milliseconds> consensusDelay) override;
|
||||
uint256
|
||||
getConsensusLCL() override;
|
||||
void
|
||||
reportFeeChange() override;
|
||||
void
|
||||
@@ -618,7 +605,6 @@ private:
|
||||
using subRpcMapType = hash_map<std::string, InfoSub::pointer>;
|
||||
|
||||
Application& app_;
|
||||
clock_type& m_clock;
|
||||
beast::Journal m_journal;
|
||||
|
||||
std::unique_ptr<LocalTxs> m_localTX;
|
||||
@@ -1740,12 +1726,6 @@ NetworkOPsImp::beginConsensus(uint256 const& networkClosed)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint256
|
||||
NetworkOPsImp::getConsensusLCL()
|
||||
{
|
||||
return mConsensus.prevLedgerID();
|
||||
}
|
||||
|
||||
bool
|
||||
NetworkOPsImp::processTrustedProposal(RCLCxPeerPos peerPos)
|
||||
{
|
||||
|
||||
@@ -239,9 +239,6 @@ public:
|
||||
std::optional<std::chrono::milliseconds> consensusDelay =
|
||||
std::nullopt) = 0;
|
||||
|
||||
virtual uint256
|
||||
getConsensusLCL() = 0;
|
||||
|
||||
virtual void
|
||||
reportFeeChange() = 0;
|
||||
|
||||
|
||||
@@ -77,16 +77,6 @@ public:
|
||||
{
|
||||
return mSocket->next_layer();
|
||||
}
|
||||
void
|
||||
setSSLOnly()
|
||||
{
|
||||
mSecure = true;
|
||||
}
|
||||
void
|
||||
setPlainOnly()
|
||||
{
|
||||
mBuffer.clear();
|
||||
}
|
||||
|
||||
beast::IP::Endpoint
|
||||
local_endpoint()
|
||||
|
||||
@@ -120,10 +120,6 @@ public:
|
||||
virtual Status
|
||||
fetch(void const* key, std::shared_ptr<NodeObject>* pObject) = 0;
|
||||
|
||||
/** Return `true` if batch fetches are optimized. */
|
||||
virtual bool
|
||||
canFetchBatch() = 0;
|
||||
|
||||
/** Fetch a batch synchronously. */
|
||||
virtual std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
|
||||
fetchBatch(std::vector<uint256 const*> const& hashes) = 0;
|
||||
@@ -164,9 +160,16 @@ public:
|
||||
virtual void
|
||||
setDeletePath() = 0;
|
||||
|
||||
/** Perform consistency checks on database. */
|
||||
/** Perform consistency checks on database.
|
||||
*
|
||||
* This method is implemented only by NuDBBackend. It is not yet called
|
||||
* anywhere, but it might be a good idea to one day call it at startup to
|
||||
* avert a crash.
|
||||
*/
|
||||
virtual void
|
||||
verify() = 0;
|
||||
verify()
|
||||
{
|
||||
}
|
||||
|
||||
/** Returns the number of file descriptors the backend expects to need. */
|
||||
virtual int
|
||||
@@ -182,13 +185,6 @@ public:
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/** Returns true if the backend uses permanent storage. */
|
||||
bool
|
||||
backed() const
|
||||
{
|
||||
return fdRequired();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace NodeStore
|
||||
|
||||
@@ -102,16 +102,6 @@ public:
|
||||
beast::Journal journal) = 0;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Create a Backend. */
|
||||
std::unique_ptr<Backend>
|
||||
make_Backend(
|
||||
Section const& config,
|
||||
std::size_t burstSize,
|
||||
Scheduler& scheduler,
|
||||
beast::Journal journal);
|
||||
|
||||
} // namespace NodeStore
|
||||
} // namespace ripple
|
||||
|
||||
|
||||
@@ -578,12 +578,6 @@ public:
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
struct ReadCallbackData
|
||||
{
|
||||
CassandraBackend& backend;
|
||||
@@ -815,11 +809,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
verify() override
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
fdRequired() const override
|
||||
{
|
||||
@@ -990,18 +979,6 @@ public:
|
||||
{
|
||||
return std::make_unique<CassandraBackend>(keyBytes, keyValues, journal);
|
||||
}
|
||||
|
||||
std::unique_ptr<Backend>
|
||||
createInstance(
|
||||
size_t keyBytes,
|
||||
Section const& keyValues,
|
||||
std::size_t burstSize,
|
||||
Scheduler& scheduler,
|
||||
nudb::context& context,
|
||||
beast::Journal journal) override
|
||||
{
|
||||
return std::make_unique<CassandraBackend>(keyBytes, keyValues, journal);
|
||||
}
|
||||
};
|
||||
|
||||
static CassandraFactory cassandraFactory;
|
||||
|
||||
@@ -89,7 +89,6 @@ public:
|
||||
MemoryBackend(
|
||||
size_t keyBytes,
|
||||
Section const& keyValues,
|
||||
Scheduler& scheduler,
|
||||
beast::Journal journal)
|
||||
: name_(get<std::string>(keyValues, "path")), journal_(journal)
|
||||
{
|
||||
@@ -147,12 +146,6 @@ public:
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
|
||||
fetchBatch(std::vector<uint256 const*> const& hashes) override
|
||||
{
|
||||
@@ -210,11 +203,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
verify() override
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
fdRequired() const override
|
||||
{
|
||||
@@ -248,8 +236,7 @@ MemoryFactory::createInstance(
|
||||
Scheduler& scheduler,
|
||||
beast::Journal journal)
|
||||
{
|
||||
return std::make_unique<MemoryBackend>(
|
||||
keyBytes, keyValues, scheduler, journal);
|
||||
return std::make_unique<MemoryBackend>(keyBytes, keyValues, journal);
|
||||
}
|
||||
|
||||
} // namespace NodeStore
|
||||
|
||||
@@ -210,12 +210,6 @@ public:
|
||||
return status;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
|
||||
fetchBatch(std::vector<uint256 const*> const& hashes) override
|
||||
{
|
||||
|
||||
@@ -60,12 +60,6 @@ public:
|
||||
return notFound;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
|
||||
fetchBatch(std::vector<uint256 const*> const& hashes) override
|
||||
{
|
||||
@@ -103,11 +97,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
verify() override
|
||||
{
|
||||
}
|
||||
|
||||
/** Returns the number of file descriptors the backend expects to need */
|
||||
int
|
||||
fdRequired() const override
|
||||
|
||||
@@ -88,7 +88,6 @@ private:
|
||||
public:
|
||||
beast::Journal m_journal;
|
||||
size_t const m_keyBytes;
|
||||
Scheduler& m_scheduler;
|
||||
BatchWriter m_batch;
|
||||
std::string m_name;
|
||||
std::unique_ptr<rocksdb::DB> m_db;
|
||||
@@ -104,7 +103,6 @@ public:
|
||||
: m_deletePath(false)
|
||||
, m_journal(journal)
|
||||
, m_keyBytes(keyBytes)
|
||||
, m_scheduler(scheduler)
|
||||
, m_batch(*this, scheduler)
|
||||
{
|
||||
if (!get_if_exists(keyValues, "path", m_name))
|
||||
@@ -305,12 +303,6 @@ public:
|
||||
return status;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
|
||||
fetchBatch(std::vector<uint256 const*> const& hashes) override
|
||||
{
|
||||
@@ -425,11 +417,6 @@ public:
|
||||
storeBatch(batch);
|
||||
}
|
||||
|
||||
void
|
||||
verify() override
|
||||
{
|
||||
}
|
||||
|
||||
/** Returns the number of file descriptors the backend expects to need */
|
||||
int
|
||||
fdRequired() const override
|
||||
|
||||
@@ -84,12 +84,6 @@ private:
|
||||
std::shared_ptr<Backend> archiveBackend_;
|
||||
mutable std::mutex mutex_;
|
||||
|
||||
struct Backends
|
||||
{
|
||||
std::shared_ptr<Backend> const& writableBackend;
|
||||
std::shared_ptr<Backend> const& archiveBackend;
|
||||
};
|
||||
|
||||
std::shared_ptr<NodeObject>
|
||||
fetchNodeObject(
|
||||
uint256 const& hash,
|
||||
|
||||
@@ -585,17 +585,6 @@ Shard::finalize(bool writeSQLite, std::optional<uint256> const& referenceHash)
|
||||
|
||||
try
|
||||
{
|
||||
/*
|
||||
TODO MP
|
||||
A lock is required when calling the NuDB verify function. Because
|
||||
this can be a time consuming process, the server may desync.
|
||||
Until this function is modified to work on an open database, we
|
||||
are unable to use it from rippled.
|
||||
|
||||
// Verify backend integrity
|
||||
backend_->verify();
|
||||
*/
|
||||
|
||||
// Check if a final key has been stored
|
||||
if (std::shared_ptr<NodeObject> nodeObject;
|
||||
backend_->fetch(finalKey.data(), &nodeObject) == Status::ok)
|
||||
|
||||
@@ -171,12 +171,6 @@ public:
|
||||
return m_resourceManager;
|
||||
}
|
||||
|
||||
ServerHandler&
|
||||
serverHandler()
|
||||
{
|
||||
return serverHandler_;
|
||||
}
|
||||
|
||||
Setup const&
|
||||
setup() const
|
||||
{
|
||||
|
||||
@@ -447,9 +447,6 @@ private:
|
||||
std::string
|
||||
domain() const;
|
||||
|
||||
std::optional<std::uint32_t>
|
||||
networkID() const;
|
||||
|
||||
//
|
||||
// protocol message loop
|
||||
//
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <ripple/app/rdb/RelationalDBInterface_global.h>
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/core/SociDB.h>
|
||||
#include <ripple/peerfinder/impl/Store.h>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
Reference in New Issue
Block a user