mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 21:45:52 +00:00
Remove unused functions and clean up some comments
This commit is contained in:
@@ -117,20 +117,6 @@ bool SqliteDatabase::executeSQL(const char* sql, bool fail_ok)
|
||||
return true;
|
||||
}
|
||||
|
||||
// tells you how many rows were changed by an update or insert
|
||||
int SqliteDatabase::getNumRowsAffected()
|
||||
{
|
||||
// TODO: SqliteDatabase::getNumRowsAffected()
|
||||
return(0);
|
||||
}
|
||||
|
||||
// VFALCO TODO This must be fixed!!! return value needs to be int64
|
||||
//
|
||||
int SqliteDatabase::getLastInsertID()
|
||||
{
|
||||
return(sqlite3_last_insert_rowid(mConnection));
|
||||
}
|
||||
|
||||
// returns false if there are no results
|
||||
bool SqliteDatabase::startIterRows(bool finalize)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ public:
|
||||
|
||||
// tells you how many rows were changed by an update or insert
|
||||
int getNumRowsAffected();
|
||||
int getLastInsertID();
|
||||
|
||||
// returns false if there are no results
|
||||
bool startIterRows(bool finalize);
|
||||
|
||||
@@ -43,10 +43,6 @@ public:
|
||||
return executeSQL(strSql.c_str(), fail_okay);
|
||||
}
|
||||
|
||||
// tells you how many rows were changed by an update or insert
|
||||
virtual int getNumRowsAffected()=0;
|
||||
virtual int getLastInsertID()=0;
|
||||
|
||||
// returns false if there are no results
|
||||
virtual bool startIterRows(bool finalize = true)=0;
|
||||
virtual void endIterRows()=0;
|
||||
|
||||
@@ -971,16 +971,21 @@ void NetworkOPs::mapComplete(uint256 const& hash, SHAMap::ref map)
|
||||
mConsensus->mapComplete(hash, map, true);
|
||||
}
|
||||
|
||||
void NetworkOPs::endConsensus(bool correctLCL)
|
||||
void NetworkOPs::endConsensus (bool correctLCL)
|
||||
{
|
||||
uint256 deadLedger = mLedgerMaster->getClosedLedger()->getParentHash();
|
||||
std::vector<Peer::pointer> peerList = theApp->getPeers().getPeerVector();
|
||||
BOOST_FOREACH(Peer::ref it, peerList)
|
||||
|
||||
std::vector <Peer::pointer> peerList = theApp->getPeers().getPeerVector ();
|
||||
|
||||
BOOST_FOREACH(Peer::ref it, peerList)
|
||||
{
|
||||
if (it && (it->getClosedLedgerHash() == deadLedger))
|
||||
{
|
||||
WriteLog (lsTRACE, NetworkOPs) << "Killing obsolete peer status";
|
||||
it->cycleStatus();
|
||||
}
|
||||
}
|
||||
|
||||
mConsensus = boost::shared_ptr<LedgerConsensus>();
|
||||
}
|
||||
|
||||
@@ -990,33 +995,43 @@ void NetworkOPs::consensusViewChange()
|
||||
setMode(omCONNECTED);
|
||||
}
|
||||
|
||||
void NetworkOPs::pubServer()
|
||||
void NetworkOPs::pubServer ()
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||
// VFALCO TODO Don't hold the lock across calls to send...make a copy of the
|
||||
// list into a local array while holding the lock then release the
|
||||
// lock and call send on everyone.
|
||||
//
|
||||
boost::recursive_mutex::scoped_lock sl (mMonitorLock);
|
||||
|
||||
if (!mSubServer.empty())
|
||||
{
|
||||
Json::Value jvObj(Json::objectValue);
|
||||
if (!mSubServer.empty ())
|
||||
{
|
||||
Json::Value jvObj (Json::objectValue);
|
||||
|
||||
jvObj["type"] = "serverStatus";
|
||||
jvObj["server_status"] = strOperatingMode();
|
||||
jvObj["load_base"] = (mLastLoadBase = theApp->getFeeTrack().getLoadBase());
|
||||
jvObj["load_factor"] = (mLastLoadFactor = theApp->getFeeTrack().getLoadFactor());
|
||||
jvObj ["type"] = "serverStatus";
|
||||
jvObj ["server_status"] = strOperatingMode();
|
||||
jvObj ["load_base"] = (mLastLoadBase = theApp->getFeeTrack().getLoadBase());
|
||||
jvObj ["load_factor"] = (mLastLoadFactor = theApp->getFeeTrack().getLoadFactor());
|
||||
|
||||
NetworkOPs::subMapType::const_iterator it = mSubServer.begin();
|
||||
while (it != mSubServer.end())
|
||||
{
|
||||
InfoSub::pointer p = it->second.lock();
|
||||
if (p)
|
||||
{
|
||||
p->send(jvObj, true);
|
||||
++it;
|
||||
}
|
||||
else
|
||||
it = mSubServer.erase(it);
|
||||
}
|
||||
NetworkOPs::subMapType::const_iterator it = mSubServer.begin();
|
||||
|
||||
}
|
||||
while (it != mSubServer.end())
|
||||
{
|
||||
InfoSub::pointer p = it->second.lock();
|
||||
|
||||
// VFALCO TODO research the possibility of using thread queues and linearizing
|
||||
// the deletion of subscribers with the sending of JSON data.
|
||||
if (p)
|
||||
{
|
||||
p->send(jvObj, true);
|
||||
|
||||
++it;
|
||||
}
|
||||
else
|
||||
{
|
||||
it = mSubServer.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkOPs::setMode(OperatingMode om)
|
||||
@@ -1662,9 +1677,11 @@ bool NetworkOPs::subBook(InfoSub::ref isrListener, const uint160& currencyPays,
|
||||
{
|
||||
BookListeners::pointer listeners =
|
||||
theApp->getOrderBookDB().makeBookListeners(currencyPays, currencyGets, issuerPays, issuerGets);
|
||||
if (listeners)
|
||||
|
||||
if (listeners)
|
||||
listeners->addSubscriber(isrListener);
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetworkOPs::unsubBook(uint64 uSeq,
|
||||
|
||||
@@ -25,7 +25,22 @@ public:
|
||||
omFULL = 4 // we have the ledger and can even validate
|
||||
};
|
||||
|
||||
typedef boost::unordered_map<uint64, InfoSub::wptr> subMapType;
|
||||
#if 0
|
||||
/** Subscription data interface.
|
||||
*/
|
||||
class Subscriber
|
||||
{
|
||||
public:
|
||||
typedef boost::weak_ptr <Subscriber> WeakPtr;
|
||||
|
||||
/** Called every time new JSON data is available.
|
||||
*/
|
||||
virtual void onSubscriberReceiveJSON (Json::Value const& json) { }
|
||||
};
|
||||
typedef boost::unordered_map <uint64, Subscriber::WeakPtr> subMapType;
|
||||
#endif
|
||||
|
||||
typedef boost::unordered_map <uint64, InfoSub::wptr> subMapType;
|
||||
|
||||
public:
|
||||
NetworkOPs(boost::asio::io_service& io_service, LedgerMaster* pLedgerMaster);
|
||||
|
||||
@@ -215,10 +215,8 @@ void JobQueue::IOThread(boost::mutex::scoped_lock& sl)
|
||||
// do jobs until asked to stop
|
||||
void JobQueue::threadEntry()
|
||||
{
|
||||
|
||||
// VFALCO TODO Replace this mutex nonsense
|
||||
//
|
||||
boost::mutex::scoped_lock sl(mJobLock);
|
||||
|
||||
while (1)
|
||||
{
|
||||
setCallingThreadName("waiting");
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
|
||||
// VFALCO TODO Fix this right. It's not really needed
|
||||
// to include this file, its a hack to keep
|
||||
// __STDC_LIMIT_MACROS from generating redefinition warnings
|
||||
// to include this file, its a hack to keep
|
||||
// __STDC_LIMIT_MACROS from generating redefinition warnings
|
||||
#include "websocketpp/src/rng/boost_rng.hpp"
|
||||
|
||||
// Must come first to prevent compile errors
|
||||
|
||||
Reference in New Issue
Block a user