From f2c6d214e5c2b93ac5cbdda1404924429add3b1e Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 6 May 2018 15:19:28 -0600 Subject: [PATCH] Rename hashSaplingAnchorEnd to hashFinalSaplingRoot to match spec. --- src/chain.cpp | 4 ++-- src/chain.h | 12 ++++++------ src/miner.cpp | 2 +- src/primitives/block.cpp | 4 ++-- src/primitives/block.h | 10 +++++----- src/txdb.cpp | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/chain.cpp b/src/chain.cpp index 51f1c2a2d..c9c787900 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -8,10 +8,10 @@ using namespace std; uint256 CBlockIndex::GetSaplingAnchorEnd() const { - // TODO: The block header's hashSaplingAnchorEnd is only guaranteed to + // TODO: The block header's hashFinalSaplingRoot is only guaranteed to // be valid on or after the Sapling activation height. - return hashSaplingAnchorEnd; + return hashFinalSaplingRoot; } /** diff --git a/src/chain.h b/src/chain.h index 51947ba95..76f535cea 100644 --- a/src/chain.h +++ b/src/chain.h @@ -169,7 +169,7 @@ public: //! block header int nVersion; uint256 hashMerkleRoot; - uint256 hashSaplingAnchorEnd; + uint256 hashFinalSaplingRoot; unsigned int nTime; unsigned int nBits; uint256 nNonce; @@ -200,7 +200,7 @@ public: nVersion = 0; hashMerkleRoot = uint256(); - hashSaplingAnchorEnd = uint256(); + hashFinalSaplingRoot = uint256(); nTime = 0; nBits = 0; nNonce = uint256(); @@ -218,7 +218,7 @@ public: nVersion = block.nVersion; hashMerkleRoot = block.hashMerkleRoot; - hashSaplingAnchorEnd = block.hashSaplingAnchorEnd; + hashFinalSaplingRoot = block.hashFinalSaplingRoot; nTime = block.nTime; nBits = block.nBits; nNonce = block.nNonce; @@ -250,7 +250,7 @@ public: if (pprev) block.hashPrevBlock = pprev->GetBlockHash(); block.hashMerkleRoot = hashMerkleRoot; - block.hashSaplingAnchorEnd = hashSaplingAnchorEnd; + block.hashFinalSaplingRoot = hashFinalSaplingRoot; block.nTime = nTime; block.nBits = nBits; block.nNonce = nNonce; @@ -375,7 +375,7 @@ public: READWRITE(this->nVersion); READWRITE(hashPrev); READWRITE(hashMerkleRoot); - READWRITE(hashSaplingAnchorEnd); + READWRITE(hashFinalSaplingRoot); READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce); @@ -394,7 +394,7 @@ public: block.nVersion = nVersion; block.hashPrevBlock = hashPrev; block.hashMerkleRoot = hashMerkleRoot; - block.hashSaplingAnchorEnd = hashSaplingAnchorEnd; + block.hashFinalSaplingRoot = hashFinalSaplingRoot; block.nTime = nTime; block.nBits = nBits; block.nNonce = nNonce; diff --git a/src/miner.cpp b/src/miner.cpp index b0c2875a9..41b54ad36 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -374,7 +374,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) // Fill in header pblock->hashPrevBlock = pindexPrev->GetBlockHash(); - pblock->hashSaplingAnchorEnd = uint256(); // TODO + pblock->hashFinalSaplingRoot = uint256(); // TODO UpdateTime(pblock, Params().GetConsensus(), pindexPrev); pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, Params().GetConsensus()); pblock->nSolution.clear(); diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp index b6c5ce9cc..430ac8721 100644 --- a/src/primitives/block.cpp +++ b/src/primitives/block.cpp @@ -112,12 +112,12 @@ uint256 CBlock::CheckMerkleBranch(uint256 hash, const std::vector& vMer std::string CBlock::ToString() const { std::stringstream s; - s << strprintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, hashSaplingAnchorEnd=%s, nTime=%u, nBits=%08x, nNonce=%s, vtx=%u)\n", + s << strprintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, hashFinalSaplingRoot=%s, nTime=%u, nBits=%08x, nNonce=%s, vtx=%u)\n", GetHash().ToString(), nVersion, hashPrevBlock.ToString(), hashMerkleRoot.ToString(), - hashSaplingAnchorEnd.ToString(), + hashFinalSaplingRoot.ToString(), nTime, nBits, nNonce.ToString(), vtx.size()); for (unsigned int i = 0; i < vtx.size(); i++) diff --git a/src/primitives/block.h b/src/primitives/block.h index 56288e10a..489d54711 100644 --- a/src/primitives/block.h +++ b/src/primitives/block.h @@ -26,7 +26,7 @@ public: int32_t nVersion; uint256 hashPrevBlock; uint256 hashMerkleRoot; - uint256 hashSaplingAnchorEnd; + uint256 hashFinalSaplingRoot; uint32_t nTime; uint32_t nBits; uint256 nNonce; @@ -44,7 +44,7 @@ public: READWRITE(this->nVersion); READWRITE(hashPrevBlock); READWRITE(hashMerkleRoot); - READWRITE(hashSaplingAnchorEnd); + READWRITE(hashFinalSaplingRoot); READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce); @@ -56,7 +56,7 @@ public: nVersion = CBlockHeader::CURRENT_VERSION; hashPrevBlock.SetNull(); hashMerkleRoot.SetNull(); - hashSaplingAnchorEnd.SetNull(); + hashFinalSaplingRoot.SetNull(); nTime = 0; nBits = 0; nNonce = uint256(); @@ -118,7 +118,7 @@ public: block.nVersion = nVersion; block.hashPrevBlock = hashPrevBlock; block.hashMerkleRoot = hashMerkleRoot; - block.hashSaplingAnchorEnd = hashSaplingAnchorEnd; + block.hashFinalSaplingRoot = hashFinalSaplingRoot; block.nTime = nTime; block.nBits = nBits; block.nNonce = nNonce; @@ -158,7 +158,7 @@ public: READWRITE(this->nVersion); READWRITE(hashPrevBlock); READWRITE(hashMerkleRoot); - READWRITE(hashSaplingAnchorEnd); + READWRITE(hashFinalSaplingRoot); READWRITE(nTime); READWRITE(nBits); } diff --git a/src/txdb.cpp b/src/txdb.cpp index 59ebbdf94..f996c3551 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -303,7 +303,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->hashSproutAnchor = diskindex.hashSproutAnchor; pindexNew->nVersion = diskindex.nVersion; pindexNew->hashMerkleRoot = diskindex.hashMerkleRoot; - pindexNew->hashSaplingAnchorEnd = diskindex.hashSaplingAnchorEnd; + pindexNew->hashFinalSaplingRoot = diskindex.hashFinalSaplingRoot; pindexNew->nTime = diskindex.nTime; pindexNew->nBits = diskindex.nBits; pindexNew->nNonce = diskindex.nNonce;