mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Cache the hashes of nodes known to be full below.
Remove the TNByID entries for those nodes in state trees. This reduces the memory and I/O neded during ledger fetching and prevents ledger fetching from crushing other caches.
This commit is contained in:
@@ -853,6 +853,14 @@ void SHAMap::dropCache()
|
||||
mTNByID[*root] = root;
|
||||
}
|
||||
|
||||
void SHAMap::dropBelow(SHAMapTreeNode* d)
|
||||
{
|
||||
if (d->isInner())
|
||||
for (int i = 0 ; i < 16; ++i)
|
||||
if (!d->isEmptyBranch(i))
|
||||
mTNByID.erase(d->getChildNodeID(i));
|
||||
}
|
||||
|
||||
void SHAMap::dump(bool hash)
|
||||
{
|
||||
cLog(lsINFO) << " MAP Contains";
|
||||
|
||||
Reference in New Issue
Block a user