Function to get map entry with its hash.

This commit is contained in:
JoelKatz
2013-02-20 11:59:33 -08:00
parent 24355e17fb
commit ba37349b95
2 changed files with 12 additions and 0 deletions

View File

@@ -485,6 +485,17 @@ SHAMapItem::pointer SHAMap::peekItem(const uint256& id, SHAMapTreeNode::TNType&
return leaf->peekItem();
}
SHAMapItem::pointer SHAMap::peekItem(const uint256& id, uint256& hash)
{
boost::recursive_mutex::scoped_lock sl(mLock);
SHAMapTreeNode* leaf = walkToPointer(id);
if (!leaf)
return no_item;
hash = leaf->getNodeHash();
return leaf->peekItem();
}
bool SHAMap::hasItem(const uint256& id)
{ // does the tree have an item with this ID
boost::recursive_mutex::scoped_lock sl(mLock);