Refactor SuppressionTable into IHashRouter

Conflicts:
	src/cpp/ripple/Application.h
This commit is contained in:
Vinnie Falco
2013-06-02 22:40:36 -07:00
parent fb487bdb41
commit 594c47f16b
14 changed files with 284 additions and 250 deletions

View File

@@ -36,6 +36,7 @@ Application::Application ()
// VFALCO: New stuff
, mFeeVote (IFeeVote::New (10, 50 * SYSTEM_CURRENCY_PARTS, 12.5 * SYSTEM_CURRENCY_PARTS))
, mFeeTrack (ILoadFeeTrack::New ())
, mHashRouter (IHashRouter::New (IHashRouter::getDefaultHoldTime ()))
, mValidations (IValidations::New ())
, mUNL (IUniqueNodeList::New (mIOService))
// VFALCO: End new stuff
@@ -105,6 +106,7 @@ void sigIntHandler(int)
}
#endif
// VFALCO: TODO, Figure this out it looks like the wrong tool
static void runAux(boost::asio::io_service& svc)
{
setCallingThreadName("aux");
@@ -117,6 +119,26 @@ static void runIO(boost::asio::io_service& io)
io.run();
}
bool Application::isNew(const uint256& s)
{
return mHashRouter->addSuppression(s);
}
bool Application::isNew(const uint256& s, uint64 p)
{
return mHashRouter->addSuppressionPeer(s, p);
}
bool Application::isNew(const uint256& s, uint64 p, int& f)
{
return mHashRouter->addSuppressionPeer(s, p, f);
}
bool Application::isNewFlag(const uint256& s, int f)
{
return mHashRouter->setFlag(s, f);
}
void Application::setup()
{
mJobQueue.setThreadCount();