diff --git a/src/chain.h b/src/chain.h index 76f535cea..017944bf8 100644 --- a/src/chain.h +++ b/src/chain.h @@ -155,7 +155,7 @@ public: uint256 hashSproutAnchor; //! (memory only) The anchor for the tree state up to the end of this block - uint256 hashSproutAnchorEnd; + uint256 hashFinalSproutRoot; //! Change in value held by the Sprout circuit over this block. //! Will be boost::none for older blocks on old nodes until a reindex has taken place. @@ -193,7 +193,7 @@ public: nStatus = 0; nCachedBranchId = boost::none; hashSproutAnchor = uint256(); - hashSproutAnchorEnd = uint256(); + hashFinalSproutRoot = uint256(); nSequenceId = 0; nSproutValue = boost::none; nChainSproutValue = boost::none; diff --git a/src/main.cpp b/src/main.cpp index 991e34110..931deb44c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2297,7 +2297,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin ZCIncrementalMerkleTree tree; pindex->hashSproutAnchor = tree.root(); // The genesis block contained no JoinSplits - pindex->hashSproutAnchorEnd = pindex->hashSproutAnchor; + pindex->hashFinalSproutRoot = pindex->hashSproutAnchor; } return true; } @@ -2413,7 +2413,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin view.PushSproutAnchor(tree); if (!fJustCheck) { - pindex->hashSproutAnchorEnd = tree.root(); + pindex->hashFinalSproutRoot = tree.root(); } blockundo.old_tree_root = old_tree_root; @@ -3932,7 +3932,7 @@ bool static LoadBlockIndexDB() // - This will miss chain tips; we handle the best tip below, and other // tips will be handled by ConnectTip during a re-org. if (pindex->pprev) { - pindex->pprev->hashSproutAnchorEnd = pindex->hashSproutAnchor; + pindex->pprev->hashFinalSproutRoot = pindex->hashSproutAnchor; } } @@ -3941,8 +3941,8 @@ bool static LoadBlockIndexDB() if (it == mapBlockIndex.end()) return true; chainActive.SetTip(it->second); - // Set hashSproutAnchorEnd for the end of best chain - it->second->hashSproutAnchorEnd = pcoinsTip->GetBestAnchor(SPROUT); + // Set hashFinalSproutRoot for the end of best chain + it->second->hashFinalSproutRoot = pcoinsTip->GetBestAnchor(SPROUT); PruneBlockIndexCandidates(); diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 1633c8b72..89ada7cff 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -155,7 +155,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx result.push_back(Pair("bits", strprintf("%08x", block.nBits))); result.push_back(Pair("difficulty", GetDifficulty(blockindex))); result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); - result.push_back(Pair("anchor", blockindex->hashSproutAnchorEnd.GetHex())); + result.push_back(Pair("anchor", blockindex->hashFinalSproutRoot.GetHex())); UniValue valuePools(UniValue::VARR); valuePools.push_back(ValuePoolDesc("sprout", blockindex->nChainSproutValue, blockindex->nSproutValue));