From a40f0b0f19d281a3c189875781e50c90a3b61e5c Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 14 Nov 2019 14:26:31 -0800 Subject: [PATCH] Delete sprout code from HaveJoinSplitRequirements and log reasons for failing reqs to stderr --- src/coins.cpp | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index eac89c030..167120bbd 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -622,41 +622,14 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr bool CCoinsViewCache::HaveJoinSplitRequirements(const CTransaction& tx) const { - boost::unordered_map intermediates; - - BOOST_FOREACH(const JSDescription &joinsplit, tx.vjoinsplit) - { - BOOST_FOREACH(const uint256& nullifier, joinsplit.nullifiers) - { - if (GetNullifier(nullifier, SPROUT)) { - // If the nullifier is set, this transaction - // double-spends! - return false; - } - } - - SproutMerkleTree tree; - auto it = intermediates.find(joinsplit.anchor); - if (it != intermediates.end()) { - tree = it->second; - } else if (!GetSproutAnchorAt(joinsplit.anchor, tree)) { - return false; - } - - BOOST_FOREACH(const uint256& commitment, joinsplit.commitments) - { - tree.append(commitment); - } - - intermediates.insert(std::make_pair(tree.root(), tree)); - } - for (const SpendDescription &spendDescription : tx.vShieldedSpend) { if (GetNullifier(spendDescription.nullifier, SAPLING)) // Prevent double spends + fprintf(stderr,"%s: sapling nullifier %s exists, preventing double spend\n", __FUNCTION__, spendDescription.nullifier); return false; SaplingMerkleTree tree; if (!GetSaplingAnchorAt(spendDescription.anchor, tree)) { + fprintf(stderr,"%s: missing sapling anchor: %s \n", __FUNCTION__, spendDescription.anchor); return false; } }