This commit is contained in:
Duke Leto
2019-11-05 06:54:42 -05:00
parent b40a4e9c82
commit 5b29c7cd71
3 changed files with 19 additions and 1 deletions

View File

@@ -622,6 +622,7 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
bool CCoinsViewCache::HaveJoinSplitRequirements(const CTransaction& tx) const
{
/*
boost::unordered_map<uint256, SproutMerkleTree, CCoinsKeyHasher> intermediates;
BOOST_FOREACH(const JSDescription &joinsplit, tx.vjoinsplit)
@@ -650,13 +651,17 @@ bool CCoinsViewCache::HaveJoinSplitRequirements(const CTransaction& tx) const
intermediates.insert(std::make_pair(tree.root(), tree));
}
*/
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
if (GetNullifier(spendDescription.nullifier, SAPLING)) // Prevent double spends
if (GetNullifier(spendDescription.nullifier, SAPLING)) { // Prevent double spends
fprintf(stderr,"%s: existing nullifier!",__FUNCTION__);
return false;
}
SaplingMerkleTree tree;
if (!GetSaplingAnchorAt(spendDescription.anchor, tree)) {
fprintf(stderr,"%s: missing Sapling anchor!",__FUNCTION__);
return false;
}
}