mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-28 14:35:48 +00:00
More SHA map work.
This commit is contained in:
@@ -150,6 +150,13 @@ bool SHAMapLeafNode::delItem(const uint256& tag)
|
||||
return false;
|
||||
}
|
||||
|
||||
SHAMapItem::pointer SHAMapLeafNode::findItem(const uint256& tag)
|
||||
{
|
||||
BOOST_FOREACH(SHAMapItem::pointer& it, mItems)
|
||||
if(it->getTag() == tag) return it;
|
||||
return SHAMapItem::pointer();
|
||||
}
|
||||
|
||||
SHAMapItem::pointer SHAMapLeafNode::firstItem(void)
|
||||
{
|
||||
if(mItems.size()==0) return SHAMapItem::pointer();
|
||||
@@ -178,6 +185,19 @@ bool SHAMapLeafNode::updateHash(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
SHAMapInnerNode::SHAMapInnerNode(const SHAMapNode& id) : SHAMapNode(id)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
SHAMapInnerNode::SHAMapInnerNode(const SHAMapNode& id, const std::vector<unsigned char>& contents)
|
||||
: SHAMapNode(id)
|
||||
{
|
||||
Serializer s(contents);
|
||||
for(int i=0; i<32; i++)
|
||||
mHashes[i]=s.get256(i*32);
|
||||
}
|
||||
|
||||
bool SHAMapInnerNode::setChildHash(int m, const uint256 &hash)
|
||||
{
|
||||
assert( (m>=0) && (m<32) );
|
||||
|
||||
Reference in New Issue
Block a user