mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Cleanup.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
#include "Suppression.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
bool SuppressionTable::addSuppression(const uint160& suppression)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mSuppressionMutex);
|
||||
@@ -9,15 +10,16 @@ bool SuppressionTable::addSuppression(const uint160& suppression)
|
||||
return false;
|
||||
|
||||
time_t now = time(NULL);
|
||||
time_t expireTime = now - mHoldTime;
|
||||
|
||||
boost::unordered_map< time_t, std::list<uint160> >::iterator it = mSuppressionTimes.begin();
|
||||
while (it != mSuppressionTimes.end())
|
||||
boost::unordered_map< time_t, std::list<uint160> >::iterator
|
||||
it = mSuppressionTimes.begin(), end = mSuppressionTimes.end();
|
||||
while (it != end)
|
||||
{
|
||||
if ((it->first + mHoldTime) < now)
|
||||
if (it->first <= expireTime)
|
||||
{
|
||||
for (std::list<uint160>::iterator lit = it->second.begin(), end = it->second.end();
|
||||
lit != end; ++lit)
|
||||
mSuppressionMap.erase(*lit);
|
||||
BOOST_FOREACH(const uint160& lit, it->second)
|
||||
mSuppressionMap.erase(lit);
|
||||
it = mSuppressionTimes.erase(it);
|
||||
}
|
||||
else ++it;
|
||||
|
||||
Reference in New Issue
Block a user