correct vout for sweep

This commit is contained in:
Matt Hess
2026-03-02 00:34:40 +00:00
parent 166882ad30
commit b340151c7c
+5 -4
View File
@@ -335,8 +335,9 @@ impl TransactionBuilder {
output_commitments.push(carrot_out.amount_commitment);
}
// Change output (if nonzero).
if change_amount > 0 {
// Change output — always emitted to guarantee ≥ 2 outputs (required
// by daemon sanity check). Amount may be 0 for sweeps.
{
if let (Some(change_spend), Some(change_view)) =
(self.change_spend_pubkey, self.change_view_pubkey)
{
@@ -432,8 +433,8 @@ impl TransactionBuilder {
output_index += 1;
}
// Change output.
if change_amount > 0 {
// Change output — always emitted to guarantee ≥ 2 outputs.
{
if let (Some(change_spend), Some(change_view)) =
(self.change_spend_pubkey, self.change_view_pubkey)
{