Protect-style joinsplits should anchor to the latest root for now, until #604 is resolved.
This commit is contained in:
parent
0cdfab1d92
commit
ccb439c510
|
@ -1058,7 +1058,6 @@ void CWallet::WitnessBucketCommitment(std::vector<uint256> commitments,
|
||||||
witnesses.resize(commitments.size());
|
witnesses.resize(commitments.size());
|
||||||
CBlockIndex* pindex = chainActive.Genesis();
|
CBlockIndex* pindex = chainActive.Genesis();
|
||||||
ZCIncrementalMerkleTree tree;
|
ZCIncrementalMerkleTree tree;
|
||||||
uint256 current_anchor;
|
|
||||||
|
|
||||||
while (pindex) {
|
while (pindex) {
|
||||||
CBlock block;
|
CBlock block;
|
||||||
|
@ -1089,7 +1088,7 @@ void CWallet::WitnessBucketCommitment(std::vector<uint256> commitments,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
current_anchor = tree.root();
|
uint256 current_anchor = tree.root();
|
||||||
|
|
||||||
// Consistency check: we should be able to find the current tree
|
// Consistency check: we should be able to find the current tree
|
||||||
// in our CCoins view.
|
// in our CCoins view.
|
||||||
|
@ -1099,7 +1098,8 @@ void CWallet::WitnessBucketCommitment(std::vector<uint256> commitments,
|
||||||
pindex = chainActive.Next(pindex);
|
pindex = chainActive.Next(pindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
final_anchor = current_anchor;
|
// TODO: #93; Select a root via some heuristic.
|
||||||
|
final_anchor = tree.root();
|
||||||
|
|
||||||
BOOST_FOREACH(boost::optional<ZCIncrementalWitness>& wit, witnesses) {
|
BOOST_FOREACH(boost::optional<ZCIncrementalWitness>& wit, witnesses) {
|
||||||
if (wit) {
|
if (wit) {
|
||||||
|
|
Loading…
Reference in New Issue