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:
JoelKatz
2013-04-19 14:22:52 -07:00
parent 38e3ab2b97
commit b993c6ee32
4 changed files with 78 additions and 42 deletions

View File

@@ -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";