Browse Source

dont store any info for sietch zaddr

checkpoints
DenioD 5 years ago
parent
commit
0ae0994978
  1. 2
      lib/src/lightclient.rs
  2. 16
      lib/src/lightwallet.rs

2
lib/src/lightclient.rs

@ -877,7 +877,7 @@ impl LightClient {
let wallet = self.wallet.write().unwrap();
match addr_type {
"zs" => wallet.add_zaddr(),
"zs" => wallet.add_zaddrdust(),
_ => {
let e = format!("Unrecognized address type: {}", addr_type);

16
lib/src/lightwallet.rs

@ -458,6 +458,22 @@ impl LightWallet {
self.extfvks.write().unwrap().push(extfvk);
self.zaddress.write().unwrap().push(address);
zaddr
}
pub fn add_zaddrdust(&self) -> String {
if !self.unlocked {
return "".to_string();
}
let pos = self.extsks.read().unwrap().len() as u32;
let bip39_seed = bip39::Seed::new(&Mnemonic::from_entropy(&self.seed, Language::English).unwrap(), "");
let (_extsk, _extfvk, address) =
LightWallet::get_zaddr_from_bip39seed(&self.config, &bip39_seed.as_bytes(), pos);
let zaddr = encode_payment_address(self.config.hrp_sapling_address(), &address);
zaddr
}

Loading…
Cancel
Save