diff --git a/src/coins.cpp b/src/coins.cpp index eac89c030..c5647f883 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -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 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; } } diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 84d416f96..ee5610a80 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -863,6 +863,7 @@ void CTxMemPool::NotifyRecentlyAdded() try { SyncWithWallets(tx, NULL); } catch (const boost::thread_interrupted&) { + fprintf(stderr,"%s: thread interrupted\n"); throw; } catch (const std::exception& e) { PrintExceptionContinue(&e, "CTxMemPool::NotifyRecentlyAdded()"); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index a93e6b4d8..0de58079e 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4533,6 +4533,18 @@ UniValue z_sendmany(const UniValue& params, bool fHelp) nTotalOut += nAmount; } + // Byrsa: Add some magic privacy zdust + unsigned int MIN_ZOUTS=7; + while (zaddrRecipients.size() < MIN_ZOUTS) { + int nAmount = 0; + string memo = "f600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + // TODO: options for address: hardcoded or randomized, unspendable or valid + // We will send various amount=0 to this wallet if our amount of zdust + // is below threshold, otherwise to unspendable or fixed out-of-wallet zaddrs + string address = "zs1aq4xnrkjlnxx0zesqye7jz3dfrf3rjh7q5z6u8l6mwyqqaam3gx3j2fkqakp33v93yavq46j83q"; // duke donation zaddr + zaddrRecipients.push_back( SendManyRecipient(address, nAmount, memo) ); + } int nextBlockHeight = chainActive.Height() + 1; CMutableTransaction mtx;