Fixed a couple incremental merkle tree bugs breaking consistency checks.

This commit is contained in:
Sean Bowe
2016-01-14 15:56:33 -07:00
parent 2c2dd2305e
commit cf47198370
3 changed files with 47 additions and 7 deletions

View File

@@ -113,14 +113,13 @@ bool CCoinsViewCache::GetAnchorAt(const uint256 &rt, libzerocash::IncrementalMer
}
}
CAnchorsCacheEntry entry;
if (!base->GetAnchorAt(rt, tree)) {
return false;
}
entry.entered = true;
entry.tree.setTo(tree);
cacheAnchors.insert(std::make_pair(rt, entry));
CAnchorsMap::iterator ret = cacheAnchors.insert(std::make_pair(rt, CAnchorsCacheEntry())).first;
ret->second.entered = true;
ret->second.tree.setTo(tree);
return true;
}