mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Some cleanups.
This commit is contained in:
@@ -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 ());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
return !!mItem;
|
||||
}
|
||||
SHAMapItem::ref peekItem ()
|
||||
{
|
||||
{ // CAUTION: Do not modify the item
|
||||
return mItem;
|
||||
}
|
||||
SHAMapItem::pointer getItem () const;
|
||||
|
||||
Reference in New Issue
Block a user