mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
bugfix.
This commit is contained in:
@@ -12,12 +12,15 @@ bool ValidationCollection::addValidation(SerializedValidation::pointer val)
|
||||
uint256 hash = val->getLedgerHash();
|
||||
uint160 node = val->getSignerPublic().getNodeID();
|
||||
|
||||
boost::mutex::scoped_lock sl(mValidationLock);
|
||||
bool ret = mValidations[hash].insert(std::make_pair(node, val)).second;
|
||||
if (ret)
|
||||
Log(lsINFO) << "Val for " << hash.GetHex() << " from " << node.GetHex() << " added " <<
|
||||
(val->isTrusted() ? "trusted" : "UNtrusted");
|
||||
return ret;
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mValidationLock);
|
||||
if (!mValidations[hash].insert(std::make_pair(node, val)).second)
|
||||
return false;
|
||||
}
|
||||
|
||||
Log(lsINFO) << "Val for " << hash.GetHex() << " from " << node.GetHex() << " added " <<
|
||||
(val->isTrusted() ? "trusted" : "UNtrusted");
|
||||
return true;
|
||||
}
|
||||
|
||||
ValidationSet ValidationCollection::getValidations(const uint256& ledger)
|
||||
@@ -38,10 +41,9 @@ void ValidationCollection::getValidationCount(const uint256& ledger, int& truste
|
||||
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)
|
||||
for (ValidationSet::iterator vit = it->second.begin(), end = it->second.end(); vit != end; ++vit)
|
||||
{
|
||||
if(vit->second->isTrusted())
|
||||
if (vit->second->isTrusted())
|
||||
++trusted;
|
||||
else
|
||||
++untrusted;
|
||||
|
||||
Reference in New Issue
Block a user