diff --git a/zcash_client_backend/src/data_api/wallet/input_selection.rs b/zcash_client_backend/src/data_api/wallet/input_selection.rs index 88f61142ab..5291306dd4 100644 --- a/zcash_client_backend/src/data_api/wallet/input_selection.rs +++ b/zcash_client_backend/src/data_api/wallet/input_selection.rs @@ -403,11 +403,13 @@ where #[cfg(not(feature = "orchard"))] let orchard_input_total = NonNegativeAmount::ZERO; - let use_sapling = - !(sapling_outputs.is_empty() && orchard_input_total >= amount_required); + // Use Sapling inputs if there are no Orchard outputs or there are not sufficient + // Orchard outputs to cover the amount required. + let use_sapling = orchard_outputs.is_empty() || amount_required > orchard_input_total; + // Use Orchard inputs if there are insufficient Sapling funds to cover the amount + // reqiuired. #[cfg(feature = "orchard")] - let use_orchard = - !(orchard_outputs.is_empty() && sapling_input_total >= amount_required); + let use_orchard = amount_required > sapling_input_total; let sapling_inputs = if use_sapling { shielded_inputs