mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
If a tree consists only of a matching leaf, don't include that leaf in the fetch pack.
This commit is contained in:
@@ -440,6 +440,10 @@ bool SHAMap::deepCompare (SHAMap& other)
|
|||||||
|
|
||||||
bool SHAMap::hasInnerNode (const SHAMapNode& nodeID, uint256 const& nodeHash)
|
bool SHAMap::hasInnerNode (const SHAMapNode& nodeID, uint256 const& nodeHash)
|
||||||
{
|
{
|
||||||
|
boost::unordered_map<SHAMapNode, SHAMapTreeNode::pointer>::iterator it = mTNByID.find (nodeID);
|
||||||
|
if (it != mTNByID.end())
|
||||||
|
return it->second->getNodeHash() == nodeHash;
|
||||||
|
|
||||||
SHAMapTreeNode* node = root.get ();
|
SHAMapTreeNode* node = root.get ();
|
||||||
|
|
||||||
while (node->isInner () && (node->getDepth () < nodeID.getDepth ()))
|
while (node->isInner () && (node->getDepth () < nodeID.getDepth ()))
|
||||||
@@ -474,7 +478,7 @@ bool SHAMap::hasLeafNode (uint256 const& tag, uint256 const& nodeHash)
|
|||||||
node = getNodePointer (node->getChildNodeID (branch), nextHash);
|
node = getNodePointer (node->getChildNodeID (branch), nextHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return node->getNodeHash() == nodeHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addFPtoList (std::list<SHAMap::fetchPackEntry_t>& list, const uint256& hash, const Blob& blob)
|
static void addFPtoList (std::list<SHAMap::fetchPackEntry_t>& list, const uint256& hash, const Blob& blob)
|
||||||
|
|||||||
Reference in New Issue
Block a user