From fb7d669f1422e47e012a699a1966f60ba351917b Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 22 Aug 2025 07:09:15 -0400 Subject: [PATCH] Remove commented out code --- src/wallet/asyncrpcoperation_sendmany.cpp | 27 +---------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index 5d23d75f6..448a4bcf8 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -409,33 +409,8 @@ bool AsyncRPCOperation_sendmany::main_impl() { if(fZdebug) LogPrintf("%s: Selecting Sapling notes\n", __FUNCTION__); std::vector ops; - std::vector notes; CAmount sum = 0; - /* - //NOTE: z_sapling_inputs_ is a list of all potential notes to spend - // saplingNoteInputs_ is a list of notes we will actually spend - // and need to lock. It is a subset of z_sapling_inputs_ - for (const auto t : z_sapling_inputs_) { - // locked status of these inputs may have changed, check again - const bool isLocked = pwalletMain->IsLockedNote(t.op); - if (isLocked) { - LogPrintf("%s: skipping locked note %s\n", __func__, t.op.hash.ToString().substr(0,10).c_str()); - continue; - } - - // keep track of currently unlocked notes to lock later on in lock_notes() - saplingNoteInputs_.emplace_back(t.op, t.note, t.note.value() ); - - ops.push_back(t.op); - notes.push_back(t.note); - sum += t.note.value(); - if (sum >= targetAmount) { - break; - } - } - */ - for(const auto t : saplingNoteInputs_) { ops.push_back(std::get<0>(t)); } @@ -455,9 +430,9 @@ bool AsyncRPCOperation_sendmany::main_impl() { for (size_t i = 0; i < saplingNoteInputs_.size(); i++) { //LOCK2(cs_main, pwalletMain->cs_wallet); + //TODO: avoid coredump here if this index does not exist if (!witnesses[i]) { throw JSONRPCError(RPC_WALLET_ERROR, - //strprintf( "Missing witness for Sapling note at outpoint %s", saplingNoteInputs_[i].op.ToString()) strprintf( "Missing witness for Sapling note at outpoint %s", std::get<0>(saplingNoteInputs_[i]).ToString()) ); }