Browse Source

Add `PushSaplingAnchor`

pull/4/head
Sean Bowe 6 years ago
parent
commit
85b39f57bb
  1. 9
      src/coins.cpp
  2. 6
      src/coins.h

9
src/coins.cpp

@ -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,

6
src/coins.h

@ -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);

Loading…
Cancel
Save