CLC needs validation counts for previous ledgers.

This commit is contained in:
JoelKatz
2012-07-09 10:41:27 -07:00
parent 808e2c7487
commit 75f3b4129c
2 changed files with 16 additions and 0 deletions

View File

@@ -75,6 +75,21 @@ void ValidationCollection::getValidationCount(const uint256& ledger, bool curren
}
}
int ValidationCollection::getTrustedValidationCount(const uint256& ledger)
{
int trusted = 0;
boost::mutex::scoped_lock sl(mValidationLock);
boost::unordered_map<uint256, ValidationSet>::iterator it = mValidations.find(ledger);
if (it != mValidations.end())
{
for (ValidationSet::iterator vit = it->second.begin(), end = it->second.end(); vit != end; ++vit)
{
if (vit->second->isTrusted())
++trusted;
}
}
}
boost::unordered_map<uint256, int> ValidationCollection::getCurrentValidations()
{
uint64 now = theApp->getOPs().getNetworkTimeNC();