From 10a6733bc661010ddc90554c1cd36fb1163d2482 Mon Sep 17 00:00:00 2001 From: zancas Date: Thu, 10 Aug 2023 21:47:29 -0600 Subject: [PATCH] clean up conditions, and only generate sapling diversifier if necessary --- zingolib/src/wallet/keys/unified.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/zingolib/src/wallet/keys/unified.rs b/zingolib/src/wallet/keys/unified.rs index b73b54934d..65119e475f 100644 --- a/zingolib/src/wallet/keys/unified.rs +++ b/zingolib/src/wallet/keys/unified.rs @@ -205,7 +205,7 @@ impl WalletCapability { }; // produce a Sapling address to increment Sapling diversifier index - let sapling_address = if self.sapling.can_view() { + let sapling_receiver = if desired_receivers.sapling && self.sapling.can_view() { let mut sapling_diversifier_index = DiversifierIndex::new(); let mut address; let mut count = 0; @@ -218,7 +218,6 @@ impl WalletCapability { sapling_diversifier_index .increment() .expect("diversifier index overflow"); - dbg!(count); if count == self.addresses.len() { break; } @@ -228,11 +227,6 @@ impl WalletCapability { } else { None }; - let sapling_receiver = if desired_receivers.sapling { - sapling_address - } else { - None - }; let transparent_receiver = if desired_receivers.transparent { let child_index = KeyIndex::from_index(self.addresses.len() as u32).unwrap();