Add PushSaplingAnchor

This commit is contained in:
Sean Bowe
2018-05-06 21:38:45 -06:00
parent c643ff0b51
commit 85b39f57bb
2 changed files with 14 additions and 1 deletions

View File

@@ -231,6 +231,15 @@ void CCoinsViewCache::PushSproutAnchor(const ZCIncrementalMerkleTree &tree) {
);
}
void CCoinsViewCache::PushSaplingAnchor(const ZCSaplingIncrementalMerkleTree &tree) {
AbstractPushAnchor<ZCSaplingIncrementalMerkleTree, CAnchorsSaplingMap, CAnchorsSaplingMap::iterator, CAnchorsSaplingCacheEntry>(
tree,
SAPLING,
cacheSaplingAnchors,
hashSaplingAnchor
);
}
template<>
void CCoinsViewCache::BringBestAnchorIntoCache(
const uint256 &currentRoot,

View File

@@ -478,10 +478,14 @@ public:
CNullifiersMap &mapSaplingNullifiers);
// Adds the tree to mapAnchors and sets the current commitment
// Adds the tree to mapSproutAnchors and sets the current commitment
// root to this root.
void PushSproutAnchor(const ZCIncrementalMerkleTree &tree);
// Adds the tree to mapSaplingAnchors and sets the current commitment
// root to this root.
void PushSaplingAnchor(const ZCSaplingIncrementalMerkleTree &tree);
// Removes the current commitment root from mapAnchors and sets
// the new current root.
void PopAnchor(const uint256 &rt, ShieldedType type);