Rename hashSproutAnchorEnd to hashFinalSproutRoot to be consistent.
This commit is contained in:
parent
f2c6d214e5
commit
e814be60fe
|
@ -155,7 +155,7 @@ public:
|
||||||
uint256 hashSproutAnchor;
|
uint256 hashSproutAnchor;
|
||||||
|
|
||||||
//! (memory only) The anchor for the tree state up to the end of this block
|
//! (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.
|
//! 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.
|
//! Will be boost::none for older blocks on old nodes until a reindex has taken place.
|
||||||
|
@ -193,7 +193,7 @@ public:
|
||||||
nStatus = 0;
|
nStatus = 0;
|
||||||
nCachedBranchId = boost::none;
|
nCachedBranchId = boost::none;
|
||||||
hashSproutAnchor = uint256();
|
hashSproutAnchor = uint256();
|
||||||
hashSproutAnchorEnd = uint256();
|
hashFinalSproutRoot = uint256();
|
||||||
nSequenceId = 0;
|
nSequenceId = 0;
|
||||||
nSproutValue = boost::none;
|
nSproutValue = boost::none;
|
||||||
nChainSproutValue = boost::none;
|
nChainSproutValue = boost::none;
|
||||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -2297,7 +2297,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
||||||
ZCIncrementalMerkleTree tree;
|
ZCIncrementalMerkleTree tree;
|
||||||
pindex->hashSproutAnchor = tree.root();
|
pindex->hashSproutAnchor = tree.root();
|
||||||
// The genesis block contained no JoinSplits
|
// The genesis block contained no JoinSplits
|
||||||
pindex->hashSproutAnchorEnd = pindex->hashSproutAnchor;
|
pindex->hashFinalSproutRoot = pindex->hashSproutAnchor;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2413,7 +2413,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
||||||
|
|
||||||
view.PushSproutAnchor(tree);
|
view.PushSproutAnchor(tree);
|
||||||
if (!fJustCheck) {
|
if (!fJustCheck) {
|
||||||
pindex->hashSproutAnchorEnd = tree.root();
|
pindex->hashFinalSproutRoot = tree.root();
|
||||||
}
|
}
|
||||||
blockundo.old_tree_root = old_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
|
// - This will miss chain tips; we handle the best tip below, and other
|
||||||
// tips will be handled by ConnectTip during a re-org.
|
// tips will be handled by ConnectTip during a re-org.
|
||||||
if (pindex->pprev) {
|
if (pindex->pprev) {
|
||||||
pindex->pprev->hashSproutAnchorEnd = pindex->hashSproutAnchor;
|
pindex->pprev->hashFinalSproutRoot = pindex->hashSproutAnchor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3941,8 +3941,8 @@ bool static LoadBlockIndexDB()
|
||||||
if (it == mapBlockIndex.end())
|
if (it == mapBlockIndex.end())
|
||||||
return true;
|
return true;
|
||||||
chainActive.SetTip(it->second);
|
chainActive.SetTip(it->second);
|
||||||
// Set hashSproutAnchorEnd for the end of best chain
|
// Set hashFinalSproutRoot for the end of best chain
|
||||||
it->second->hashSproutAnchorEnd = pcoinsTip->GetBestAnchor(SPROUT);
|
it->second->hashFinalSproutRoot = pcoinsTip->GetBestAnchor(SPROUT);
|
||||||
|
|
||||||
PruneBlockIndexCandidates();
|
PruneBlockIndexCandidates();
|
||||||
|
|
||||||
|
|
|
@ -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("bits", strprintf("%08x", block.nBits)));
|
||||||
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
|
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
|
||||||
result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex()));
|
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);
|
UniValue valuePools(UniValue::VARR);
|
||||||
valuePools.push_back(ValuePoolDesc("sprout", blockindex->nChainSproutValue, blockindex->nSproutValue));
|
valuePools.push_back(ValuePoolDesc("sprout", blockindex->nChainSproutValue, blockindex->nSproutValue));
|
||||||
|
|
Loading…
Reference in New Issue