Small bits.

This commit is contained in:
JoelKatz
2012-07-25 01:51:41 -07:00
parent 39ed76a8ff
commit b31ae630cf
2 changed files with 29 additions and 2 deletions

View File

@@ -172,3 +172,30 @@ Json::Value TransactionMetaSet::getJson(int v) const
return ret;
}
bool TransactionMetaSet::isNodeAffected(const uint256& node) const
{
for (std::set<TransactionMetaNode>::const_iterator it = mNodes.begin(), end = mNodes.end();
it != end; ++it)
if (it->getNode() == node)
return true;
return false;
}
TransactionMetaNode TransactionMetaSet::getAffectedNode(const uint256& node)
{
for (std::set<TransactionMetaNode>::const_iterator it = mNodes.begin(), end = mNodes.end();
it != end; ++it)
if (it->getNode() == node)
return *it;
return TransactionMetaNode(uint256());
}
const TransactionMetaNode& TransactionMetaSet::peekAffectedNode(const uint256& node) const
{
for (std::set<TransactionMetaNode>::const_iterator it = mNodes.begin(), end = mNodes.end();
it != end; ++it)
if (it->getNode() == node)
return *it;
throw std::runtime_error("Affected node not found");
}