diff --git a/src/chain.cpp b/src/chain.cpp index 39520cc8f..51f1c2a2d 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -7,6 +7,13 @@ using namespace std; +uint256 CBlockIndex::GetSaplingAnchorEnd() const { + // TODO: The block header's hashSaplingAnchorEnd is only guaranteed to + // be valid on or after the Sapling activation height. + + return hashSaplingAnchorEnd; +} + /** * CChain implementation */ diff --git a/src/chain.h b/src/chain.h index 4857435ed..51947ba95 100644 --- a/src/chain.h +++ b/src/chain.h @@ -321,6 +321,9 @@ public: //! Efficiently find an ancestor of this block. CBlockIndex* GetAncestor(int height); const CBlockIndex* GetAncestor(int height) const; + + //! Get the root of the Sapling merkle tree (at the end of this block) + uint256 GetSaplingAnchorEnd() const; }; /** Used to marshal pointers into hashes for db storage. */