Rename hashSproutAnchorEnd to hashFinalSproutRoot to be consistent.

This commit is contained in:
Sean Bowe 2018-05-06 15:21:49 -06:00
parent f2c6d214e5
commit e814be60fe
3 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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