Add consensus support for Sapling merkle trees.

This commit is contained in:
Sean Bowe
2018-05-06 23:27:52 -06:00
parent 85b39f57bb
commit 1f8be05b63
5 changed files with 47 additions and 25 deletions

View File

@@ -585,9 +585,12 @@ bool CCoinsViewCache::HaveJoinSplitRequirements(const CTransaction& tx) const
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
if (GetNullifier(spendDescription.nullifier, SAPLING)) // Prevent double spends
return false;
}
// TODO: Sapling anchor checks
ZCSaplingIncrementalMerkleTree tree;
if (!GetSaplingAnchorAt(spendDescription.anchor, tree)) {
return false;
}
}
return true;
}