diff --git a/src/sapling/sapling_operation.cpp b/src/sapling/sapling_operation.cpp index 3e397f9d4a73..4315fcc90207 100644 --- a/src/sapling/sapling_operation.cpp +++ b/src/sapling/sapling_operation.cpp @@ -285,9 +285,9 @@ OperationResult SaplingOperation::loadUtxos(TxValues& txValues) return errorOut("Insufficient funds, no available UTXO to spend"); } - // sort in ascending order, so smaller utxos appear first + // sort in descending order, so higher utxos appear first std::sort(transInputs.begin(), transInputs.end(), [](const COutput& i, const COutput& j) -> bool { - return i.Value() < j.Value(); + return i.Value() > j.Value(); }); // Final step, append utxo to the transaction