Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trivial] Remove dead code #3753

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Builds/CMake/deps/cassandra.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if(reporting)
GIT_REPOSITORY https://github.com/krb5/krb5.git
GIT_TAG master
UPDATE_COMMAND ""
CONFIGURE_COMMAND autoreconf src && ./src/configure --enable-static --disable-shared > /dev/null
CONFIGURE_COMMAND autoreconf src && CFLAGS=-fcommon ./src/configure --enable-static --disable-shared > /dev/null
BUILD_IN_SOURCE 1
BUILD_COMMAND make
INSTALL_COMMAND ""
Expand Down
11 changes: 0 additions & 11 deletions src/ripple/app/ledger/AcceptedLedger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions src/ripple/app/ledger/AcceptedLedger.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ class AcceptedLedger
return mMap.size();
}

AcceptedLedgerTx::pointer
getTxn(int) const;

AcceptedLedger(
std::shared_ptr<ReadView const> const& ledger,
Application& app);
Expand Down
6 changes: 0 additions & 6 deletions src/ripple/app/ledger/LedgerMaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ class ReportingShouldProxy : public std::runtime_error
class LedgerMaster : public Stoppable, 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,
Expand Down Expand Up @@ -243,8 +239,6 @@ class LedgerMaster : public Stoppable, public AbstractFetchPackContainer
uint256 const& consensusHash,
Json::Value consensus);

LedgerIndex
getBuildingLedger();
void
setBuildingLedger(LedgerIndex index);

Expand Down
6 changes: 0 additions & 6 deletions src/ripple/app/ledger/LedgerReplayTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ class LedgerReplayTask final
bool
finished() const;

static char const*
getCountedObjectName()
{
return "LedgerReplayTask";
}

private:
void
onTimer(bool progress, ScopedLockType& sl) override;
Expand Down
6 changes: 0 additions & 6 deletions src/ripple/app/ledger/impl/LedgerDeltaAcquire.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ class LedgerDeltaAcquire final
void
addDataCallback(InboundLedger::Reason reason, OnDeltaDataCB&& cb);

static char const*
getCountedObjectName()
{
return "LedgerDeltaAcquire";
}

private:
void
onTimer(bool progress, ScopedLockType& peerSetLock) override;
Expand Down
7 changes: 0 additions & 7 deletions src/ripple/app/ledger/impl/LedgerMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,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)
{
Expand Down
6 changes: 0 additions & 6 deletions src/ripple/app/ledger/impl/SkipListAcquire.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ class SkipListAcquire final
std::shared_ptr<SkipListData const>
getData() const;

static char const*
getCountedObjectName()
{
return "SkipListAcquire";
}

private:
void
onTimer(bool progress, ScopedLockType& peerSetLock) override;
Expand Down
1 change: 0 additions & 1 deletion src/ripple/app/main/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ class ApplicationImp : public Application, public RootStoppable, public BasicApp
std::unique_ptr<RelationalDBInterface> mRelationalDBInterface;
std::unique_ptr<DatabaseCon> mWalletDB;
std::unique_ptr<Overlay> overlay_;
std::vector<std::unique_ptr<Stoppable>> websocketServers_;

boost::asio::signal_set m_signals;

Expand Down
20 changes: 0 additions & 20 deletions src/ripple/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -231,7 +229,6 @@ class NetworkOPsImp final : public NetworkOPs
beast::insight::Collector::ptr const& collector)
: NetworkOPs(parent)
, app_(app)
, m_clock(clock)
, m_journal(journal)
, m_localTX(make_LocalTxs())
, mMode(start_valid ? OperatingMode::FULL : OperatingMode::DISCONNECTED)
Expand Down Expand Up @@ -364,14 +361,6 @@ class NetworkOPsImp final : public NetworkOPs
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;

Expand Down Expand Up @@ -442,8 +431,6 @@ class NetworkOPsImp final : public NetworkOPs
std::uint32_t
acceptLedger(
std::optional<std::chrono::milliseconds> consensusDelay) override;
uint256
getConsensusLCL() override;
void
reportFeeChange() override;
void
Expand Down Expand Up @@ -626,7 +613,6 @@ class NetworkOPsImp final : public NetworkOPs
using subRpcMapType = hash_map<std::string, InfoSub::pointer>;

Application& app_;
clock_type& m_clock;
beast::Journal m_journal;

std::unique_ptr<LocalTxs> m_localTX;
Expand Down Expand Up @@ -1748,12 +1734,6 @@ NetworkOPsImp::beginConsensus(uint256 const& networkClosed)
return true;
}

uint256
NetworkOPsImp::getConsensusLCL()
{
return mConsensus.prevLedgerID();
}

bool
NetworkOPsImp::processTrustedProposal(RCLCxPeerPos peerPos)
{
Expand Down
3 changes: 0 additions & 3 deletions src/ripple/app/misc/NetworkOPs.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ class NetworkOPs : public InfoSub::Source
std::optional<std::chrono::milliseconds> consensusDelay =
std::nullopt) = 0;

virtual uint256
getConsensusLCL() = 0;

virtual void
reportFeeChange() = 0;

Expand Down
10 changes: 0 additions & 10 deletions src/ripple/net/AutoSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,6 @@ class AutoSocket
{
return mSocket->next_layer();
}
void
setSSLOnly()
{
mSecure = true;
}
void
setPlainOnly()
{
mBuffer.clear();
}

beast::IP::Endpoint
local_endpoint()
Expand Down
22 changes: 9 additions & 13 deletions src/ripple/nodestore/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ class Backend
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;
Expand Down Expand Up @@ -164,9 +160,16 @@ class Backend
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
Expand All @@ -182,13 +185,6 @@ class Backend
{
return std::nullopt;
}

/** Returns true if the backend uses permanent storage. */
bool
backed() const
{
return fdRequired();
}
};

} // namespace NodeStore
Expand Down
10 changes: 0 additions & 10 deletions src/ripple/nodestore/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ class Manager
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

Expand Down
23 changes: 0 additions & 23 deletions src/ripple/nodestore/backend/CassandraFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,6 @@ class CassandraBackend : public Backend
return ok;
}

bool
canFetchBatch() override
{
return true;
}

struct ReadCallbackData
{
CassandraBackend& backend;
Expand Down Expand Up @@ -815,11 +809,6 @@ class CassandraBackend : public Backend
{
}

void
verify() override
{
}

int
fdRequired() const override
{
Expand Down Expand Up @@ -990,18 +979,6 @@ class CassandraFactory : public Factory
{
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;
Expand Down
15 changes: 1 addition & 14 deletions src/ripple/nodestore/backend/MemoryFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class MemoryBackend : public Backend
MemoryBackend(
size_t keyBytes,
Section const& keyValues,
Scheduler& scheduler,
beast::Journal journal)
: name_(get<std::string>(keyValues, "path")), journal_(journal)
{
Expand Down Expand Up @@ -147,12 +146,6 @@ class MemoryBackend : public Backend
return ok;
}

bool
canFetchBatch() override
{
return false;
}

std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
fetchBatch(std::vector<uint256 const*> const& hashes) override
{
Expand Down Expand Up @@ -210,11 +203,6 @@ class MemoryBackend : public Backend
{
}

void
verify() override
{
}

int
fdRequired() const override
{
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions src/ripple/nodestore/backend/NuDBFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,6 @@ class NuDBBackend : public Backend
return status;
}

bool
canFetchBatch() override
{
return true;
}

std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
fetchBatch(std::vector<uint256 const*> const& hashes) override
{
Expand Down
11 changes: 0 additions & 11 deletions src/ripple/nodestore/backend/NullFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ class NullBackend : public Backend
return notFound;
}

bool
canFetchBatch() override
{
return false;
}

std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
fetchBatch(std::vector<uint256 const*> const& hashes) override
{
Expand Down Expand Up @@ -103,11 +97,6 @@ class NullBackend : public Backend
{
}

void
verify() override
{
}

/** Returns the number of file descriptors the backend expects to need */
int
fdRequired() const override
Expand Down
Loading