mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Updates.
This commit is contained in:
@@ -51,7 +51,7 @@ void SHAMap::dirtyUp(std::stack<SHAMapTreeNode::pointer>& stack, const uint256&
|
||||
{ // walk the tree up from through the inner nodes to the root
|
||||
// update linking hashes and add nodes to dirty list
|
||||
|
||||
assert(mState!=Synching && mState!=Immutable);
|
||||
assert((mState != Synching) && (mState != Immutable));
|
||||
|
||||
while (!stack.empty())
|
||||
{
|
||||
@@ -166,7 +166,7 @@ SHAMapItem::pointer SHAMap::firstBelow(SHAMapTreeNode::pointer node)
|
||||
if (node->hasItem()) return node->peekItem();
|
||||
|
||||
bool foundNode = false;
|
||||
for(int i=0; i<16; i++)
|
||||
for (int i = 0; i < 16; ++i)
|
||||
if (!node->isEmptyBranch(i))
|
||||
{
|
||||
#ifdef ST_DEBUG
|
||||
@@ -194,7 +194,7 @@ SHAMapItem::pointer SHAMap::lastBelow(SHAMapTreeNode::pointer node)
|
||||
if (node->hasItem()) return node->peekItem();
|
||||
|
||||
bool foundNode = false;
|
||||
for(int i=15; i>=0; i++)
|
||||
for (int i = 15; i >= 0; ++i)
|
||||
if (!node->isEmptyBranch(i))
|
||||
{
|
||||
node = getNode(node->getChildNodeID(i), node->getChildHash(i), false);
|
||||
@@ -215,7 +215,7 @@ SHAMapItem::pointer SHAMap::onlyBelow(SHAMapTreeNode::pointer node)
|
||||
found = false;
|
||||
SHAMapTreeNode::pointer nextNode;
|
||||
|
||||
for(int i=0; i<16; i++)
|
||||
for (int i = 0; i < 16; ++i)
|
||||
if (!node->isEmptyBranch(i))
|
||||
{
|
||||
if( found) return SHAMapItem::pointer(); // two leaves below
|
||||
@@ -618,11 +618,11 @@ void SHAMap::dump(bool hash)
|
||||
|
||||
}
|
||||
|
||||
static std::vector<unsigned char>IntToVUC(int i)
|
||||
static std::vector<unsigned char>IntToVUC(int v)
|
||||
{
|
||||
std::vector<unsigned char> vuc;
|
||||
for(int i=0; i<32; i++)
|
||||
vuc.push_back((unsigned char) i);
|
||||
for (int i = 0; i < 32; ++i)
|
||||
vuc.push_back(static_cast<unsigned char>(v));
|
||||
return vuc;
|
||||
}
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ public:
|
||||
// status functions
|
||||
void setImmutable(void) { assert(mState != Invalid); mState = Immutable; }
|
||||
void clearImmutable(void) { mState = Modifying; }
|
||||
bool isSynching(void) const { return mState == Floating || mState == Synching; }
|
||||
bool isSynching(void) const { return (mState == Floating) || (mState == Synching); }
|
||||
void setSynching(void) { mState = Synching; }
|
||||
void setFloating(void) { mState = Floating; }
|
||||
void clearSynching(void) { mState = Modifying; }
|
||||
|
||||
Reference in New Issue
Block a user