Be more consistent.

This commit is contained in:
JoelKatz
2013-03-03 04:53:15 -08:00
parent f30a148e19
commit 9716882bc0

View File

@@ -24,7 +24,6 @@ DECLARE_INSTANCE(SHAMapTreeNode);
void SHAMapNode::setHash() const
{
std::size_t h = theApp->getNonceST() + (mDepth * 0x9e3779b9);
const unsigned int *ptr = reinterpret_cast<const unsigned int *>(mNodeID.begin());
for (int i = (mDepth + 3) / 4; i >= 0; --i)
boost::hash_combine(h, *ptr++);
@@ -163,10 +162,11 @@ SHAMapTreeNode::pointer SHAMap::walkTo(const uint256& id, bool modify)
while (!inNode->isLeaf())
{
int branch = inNode->selectBranch(id);
if (inNode->isEmptyBranch(branch))
return inNode;
uint256 childHash = inNode->getChildHash(branch);
if (childHash.isZero())
return inNode;
try
{
inNode = getNode(inNode->getChildNodeID(branch), childHash, false);