Skip to content

Commit

Permalink
clean up conditions, and only generate sapling diversifier if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
zancas committed Aug 15, 2023
1 parent 6c9ae8e commit 10a6733
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions zingolib/src/wallet/keys/unified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -218,7 +218,6 @@ impl WalletCapability {
sapling_diversifier_index
.increment()
.expect("diversifier index overflow");
dbg!(count);
if count == self.addresses.len() {
break;
}
Expand All @@ -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();
Expand Down

0 comments on commit 10a6733

Please sign in to comment.