From ccb439c5106b4a1e8172b2e94f853a572e469fe0 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Thu, 5 May 2016 21:58:02 -0600 Subject: [PATCH] Protect-style joinsplits should anchor to the latest root for now, until #604 is resolved. --- src/wallet/wallet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7698d329f..cbcb467c8 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1058,7 +1058,6 @@ void CWallet::WitnessBucketCommitment(std::vector commitments, witnesses.resize(commitments.size()); CBlockIndex* pindex = chainActive.Genesis(); ZCIncrementalMerkleTree tree; - uint256 current_anchor; while (pindex) { CBlock block; @@ -1089,7 +1088,7 @@ void CWallet::WitnessBucketCommitment(std::vector commitments, } } - current_anchor = tree.root(); + uint256 current_anchor = tree.root(); // Consistency check: we should be able to find the current tree // in our CCoins view. @@ -1099,7 +1098,8 @@ void CWallet::WitnessBucketCommitment(std::vector commitments, pindex = chainActive.Next(pindex); } - final_anchor = current_anchor; + // TODO: #93; Select a root via some heuristic. + final_anchor = tree.root(); BOOST_FOREACH(boost::optional& wit, witnesses) { if (wit) {