From b43a4f26531a27ee47fdad4a1c415c5afdafb102 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 30 May 2025 08:22:16 -0400 Subject: [PATCH] Remove unused code and formatting --- .../asyncrpcoperation_mergetoaddress.cpp | 30 +++++-------------- src/wallet/asyncrpcoperation_sendmany.cpp | 24 +-------------- 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/src/wallet/asyncrpcoperation_mergetoaddress.cpp b/src/wallet/asyncrpcoperation_mergetoaddress.cpp index e09068ac4..c2784d5a2 100644 --- a/src/wallet/asyncrpcoperation_mergetoaddress.cpp +++ b/src/wallet/asyncrpcoperation_mergetoaddress.cpp @@ -53,13 +53,13 @@ using namespace libzcash; extern UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& mypk); AsyncRPCOperation_mergetoaddress::AsyncRPCOperation_mergetoaddress( - boost::optional builder, - CMutableTransaction contextualTx, - std::vector utxoInputs, - std::vector saplingNoteInputs, - MergeToAddressRecipient recipient, - CAmount fee, - UniValue contextInfo) : + boost::optional builder, + CMutableTransaction contextualTx, + std::vector utxoInputs, + std::vector saplingNoteInputs, + MergeToAddressRecipient recipient, + CAmount fee, + UniValue contextInfo) : tx_(contextualTx), utxoInputs_(utxoInputs), saplingNoteInputs_(saplingNoteInputs), recipient_(recipient), fee_(fee), contextinfo_(contextInfo) { if (fee < 0 || fee > MAX_MONEY) { @@ -192,22 +192,6 @@ bool AsyncRPCOperation_mergetoaddress::main_impl() size_t numInputs = utxoInputs_.size(); - /* - // Check mempooltxinputlimit to avoid creating a transaction which the local mempool rejects - size_t limit = (size_t)GetArg("-mempooltxinputlimit", 0); - { - LOCK(cs_main); - if (NetworkUpgradeActive(chainActive.Height() + 1, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) { - limit = 0; - } - } - if (limit > 0 && numInputs > limit) { - throw JSONRPCError(RPC_WALLET_ERROR, - strprintf("Number of transparent inputs %d is greater than mempooltxinputlimit of %d", - numInputs, limit)); - } - */ - CAmount t_inputs_total = 0; for (MergeToAddressInputUTXO& t : utxoInputs_) { t_inputs_total += std::get<1>(t); diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index f5809c58d..b796b101f 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -205,12 +205,6 @@ bool AsyncRPCOperation_sendmany::main_impl() { assert(isfromtaddr_ != isfromzaddr_); - /* TODO: this needs to allow DPoW addresses. Consensus-time checks do it correctly. - if(t_outputs_.size() > 0) { - throw JSONRPCError(RPC_WALLET_ERROR, "Extreme Privacy! You cannot send to a transparent address."); - } - */ - bool isSingleZaddrOutput = (t_outputs_.size()==0 && z_outputs_.size()==1); bool isMultipleZaddrOutput = (t_outputs_.size()==0 && z_outputs_.size()>=1); bool isPureTaddrOnlyTx = (isfromtaddr_ && z_outputs_.size() == 0); @@ -319,23 +313,6 @@ bool AsyncRPCOperation_sendmany::main_impl() { t_inputs_ = selectedTInputs; t_inputs_total = selectedUTXOAmount; - /* - // Check mempooltxinputlimit to avoid creating a transaction which the local mempool rejects - const size_t limit = (size_t)GetArg("-mempooltxinputlimit", 0); - { - LOCK(cs_main); - if (NetworkUpgradeActive(chainActive.Height() + 1, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) { - limit = 0; - } - } - if (limit > 0) { - size_t n = t_inputs_.size(); - if (n > limit) { - throw JSONRPCError(RPC_WALLET_ERROR, strprintf("Too many transparent inputs %zu > limit %zu", n, limit)); - } - } - */ - // update the transaction with these inputs if (isUsingBuilder_) { CScript scriptPubKey; @@ -680,6 +657,7 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() { pwalletMain->GetFilteredNotes(saplingEntries, fromaddress_, mindepth_); } + // store sapling inputs so we can correctly lock and unlock them for (auto entry : saplingEntries) { z_sapling_inputs_.push_back(entry); std::string data(entry.memo.begin(), entry.memo.end());