From 796b5a4fed8a0afc542ccaf4185416bc4e056d7e Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 11 Nov 2022 00:58:31 +0000 Subject: [PATCH] ZIP 317: Improve code comments --- zcash_client_backend/src/fees/zip317.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zcash_client_backend/src/fees/zip317.rs b/zcash_client_backend/src/fees/zip317.rs index fb03298bf..174671eb1 100644 --- a/zcash_client_backend/src/fees/zip317.rs +++ b/zcash_client_backend/src/fees/zip317.rs @@ -103,8 +103,9 @@ impl ChangeStrategy for SingleOutputChangeStrategy { let mut s_disallowed_dust = sapling_dust.len().saturating_sub(s_allowed_dust); if available_grace_inputs > 0 { - // if we have available grace inputs, allocate them first to transparent dust - // and then to sapling dust + // If we have available grace inputs, allocate them first to transparent dust + // and then to Sapling dust. The caller has provided inputs that it is willing + // to spend, so we don't need to consider privacy effects at this layer. let t_grace_dust = available_grace_inputs.saturating_sub(t_disallowed_dust); t_disallowed_dust = t_disallowed_dust.saturating_sub(t_grace_dust); @@ -114,9 +115,9 @@ impl ChangeStrategy for SingleOutputChangeStrategy { s_disallowed_dust = s_disallowed_dust.saturating_sub(s_grace_dust); } - // truncate the lists of inputs to be disregarded in input selection to just the - // disallowed lengths this has the effect of prioritizing inputs for inclusion by the - // order of th original input slices, with the most preferred inputs first + // Truncate the lists of inputs to be disregarded in input selection to just the + // disallowed lengths. This has the effect of prioritizing inputs for inclusion by the + // order of the original input slices, with the most preferred inputs first. transparent_dust.reverse(); transparent_dust.truncate(t_disallowed_dust); sapling_dust.reverse();