Some cleanups.

This commit is contained in:
JoelKatz
2013-07-05 03:34:24 -07:00
parent 1fb4106f2f
commit be68458aff
3 changed files with 5 additions and 17 deletions

View File

@@ -56,7 +56,7 @@ void SHAMap::getMissingNodes (std::vector<SHAMapNode>& nodeIDs, std::vector<uint
if (!d)
{
// node is not in the map
// node is not in the database
nodeIDs.push_back (childID);
hashes.push_back (childHash);
@@ -77,12 +77,7 @@ void SHAMap::getMissingNodes (std::vector<SHAMapNode>& nodeIDs, std::vector<uint
if (have_all)
{
node->setFullBelow ();
if (mType == smtSTATE)
{
fullBelowCache.add (node->getNodeHash ());
dropBelow (node);
}
fullBelowCache.add (node->getNodeHash ());
}
}
@@ -148,12 +143,7 @@ std::vector<uint256> SHAMap::getNeededHashes (int max, SHAMapSyncFilter* filter)
if (have_all)
{
node->setFullBelow ();
if (mType == smtSTATE)
{
fullBelowCache.add (node->getNodeHash ());
dropBelow (node);
}
fullBelowCache.add (node->getNodeHash ());
}
}

View File

@@ -356,12 +356,10 @@ void SHAMapTreeNode::addRaw (Serializer& s, SHANodeFormat format)
bool SHAMapTreeNode::setItem (SHAMapItem::ref i, TNType type)
{
uint256 hash = getNodeHash ();
mType = type;
mItem = i;
assert (isLeaf ());
updateHash ();
return getNodeHash () != hash;
return updateHash ();
}
SHAMapItem::pointer SHAMapTreeNode::getItem () const

View File

@@ -122,7 +122,7 @@ public:
return !!mItem;
}
SHAMapItem::ref peekItem ()
{
{ // CAUTION: Do not modify the item
return mItem;
}
SHAMapItem::pointer getItem () const;