Bring back sorting notes descending by value which was in find_unspent_notes()

This commit is contained in:
Duke
2025-08-22 06:16:25 -04:00
parent ae170e9899
commit 7e3ce02d87

View File

@@ -5286,6 +5286,13 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
// find all unspent and unlocked notes in this zaddr
pwalletMain->GetFilteredNotes(saplingEntries, fromaddress);
// sort notes from largest to smallest, which means
// we will spend the largest first
std::sort(saplingEntries.begin(), saplingEntries.end(),
[](SaplingNoteEntry i, SaplingNoteEntry j) -> bool {
return i.note.value() > j.note.value();
});
CAmount total_value = 0;
std::vector<SendManyInputSaplingNote> saplingNoteInputs;