mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Put newly-created nodes in the treeNodeCache
This commit is contained in:
@@ -1133,15 +1133,17 @@ int SHAMap::flushDirty (DirtySet& set, int maxNodes, NodeObjectType t, std::uint
|
||||
|
||||
#endif
|
||||
|
||||
getApp().getNodeStore ().store (t, seq, std::move (s.modData ()), nodeHash);
|
||||
|
||||
if (getApp().running ())
|
||||
if (node->getSeq () != 0)
|
||||
{
|
||||
// Put the canonical version into the SHAMap and the treeNodeCache
|
||||
mTNByID.erase (*node);
|
||||
fetchNodeExternal (*node, nodeHash);
|
||||
// Node is not shareable
|
||||
// Make and share a shareable copy
|
||||
node = boost::make_shared <SHAMapTreeNode> (*node, 0);
|
||||
canonicalize (node->getNodeHash(), node);
|
||||
mTNByID.replace (*node, node);
|
||||
}
|
||||
|
||||
getApp().getNodeStore ().store (t, seq, std::move (s.modData ()), nodeHash);
|
||||
|
||||
if (flushed++ >= maxNodes)
|
||||
return flushed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user