mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Track when a node was last accessed.
This commit is contained in:
@@ -144,6 +144,7 @@ SHAMapTreeNode::pointer SHAMap::checkCacheNode(const SHAMapNode& iNode)
|
||||
boost::unordered_map<SHAMapNode, SHAMapTreeNode::pointer>::iterator it = mTNByID.find(iNode);
|
||||
if (it == mTNByID.end())
|
||||
return SHAMapTreeNode::pointer();
|
||||
it->second->touch(mSeq);
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ private:
|
||||
uint256 mHash;
|
||||
uint256 mHashes[16];
|
||||
SHAMapItem::pointer mItem;
|
||||
uint32 mSeq;
|
||||
uint32 mSeq, mAccessSeq;
|
||||
TNType mType;
|
||||
bool mFullBelow;
|
||||
|
||||
@@ -183,7 +183,8 @@ public:
|
||||
|
||||
// node functions
|
||||
uint32 getSeq() const { return mSeq; }
|
||||
void setSeq(uint32 s) { mSeq = s; }
|
||||
void setSeq(uint32 s) { mAccessSeq = mSeq = s; }
|
||||
void touch(uint32 s) { mAccessSeq = s; }
|
||||
const uint256& getNodeHash() const { return mHash; }
|
||||
TNType getType() const { return mType; }
|
||||
|
||||
|
||||
@@ -173,8 +173,8 @@ void SHAMapNode::dump() const
|
||||
Log(lsDEBUG) << getString();
|
||||
}
|
||||
|
||||
SHAMapTreeNode::SHAMapTreeNode(uint32 seq, const SHAMapNode& nodeID) : SHAMapNode(nodeID), mHash(0), mSeq(seq),
|
||||
mType(tnERROR), mFullBelow(false)
|
||||
SHAMapTreeNode::SHAMapTreeNode(uint32 seq, const SHAMapNode& nodeID) : SHAMapNode(nodeID), mHash(0),
|
||||
mSeq(seq), mAccessSeq(seq), mType(tnERROR), mFullBelow(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user