mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Cosmetic changes.
This commit is contained in:
@@ -140,7 +140,7 @@ SHAMapTreeNode::pointer SHAMap::getNode(const SHAMapNode& id, const uint256& has
|
|||||||
void SHAMap::returnNode(SHAMapTreeNode::pointer& node, bool modify)
|
void SHAMap::returnNode(SHAMapTreeNode::pointer& node, bool modify)
|
||||||
{ // make sure the node is suitable for the intended operation (copy on write)
|
{ // make sure the node is suitable for the intended operation (copy on write)
|
||||||
assert(node->isValid());
|
assert(node->isValid());
|
||||||
if (node && modify && (node->getSeq()!=mSeq))
|
if (node && modify && (node->getSeq() != mSeq))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
std::cerr << "returnNode COW" << std::endl;
|
std::cerr << "returnNode COW" << std::endl;
|
||||||
@@ -516,17 +516,17 @@ bool SHAMap::addItem(const SHAMapItem& i, bool isTransaction)
|
|||||||
|
|
||||||
bool SHAMap::updateGiveItem(SHAMapItem::pointer item, bool isTransaction)
|
bool SHAMap::updateGiveItem(SHAMapItem::pointer item, bool isTransaction)
|
||||||
{ // can't change the tag but can change the hash
|
{ // can't change the tag but can change the hash
|
||||||
uint256 tag=item->getTag();
|
uint256 tag = item->getTag();
|
||||||
|
|
||||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||||
|
|
||||||
std::stack<SHAMapTreeNode::pointer> stack = getStack(tag, true);
|
std::stack<SHAMapTreeNode::pointer> stack = getStack(tag, true);
|
||||||
if (stack.empty()) throw SHAMapException(MissingNode);
|
if (stack.empty()) throw SHAMapException(MissingNode);
|
||||||
|
|
||||||
SHAMapTreeNode::pointer node=stack.top();
|
SHAMapTreeNode::pointer node = stack.top();
|
||||||
stack.pop();
|
stack.pop();
|
||||||
|
|
||||||
if (!node->isLeaf() || (node->peekItem()->getTag() != tag) )
|
if (!node->isLeaf() || (node->peekItem()->getTag() != tag))
|
||||||
{
|
{
|
||||||
assert(false);
|
assert(false);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user