From de1144831600c5e2fdb8ccc9eaeef0759fa6774b Mon Sep 17 00:00:00 2001 From: Cryptoforge Date: Thu, 6 May 2021 18:13:37 -0700 Subject: [PATCH] remove support for taddresses --- lib/src/lightwallet.rs | 28 ++++++++++++++-------------- lib/src/lightwallet/bugs.rs | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/src/lightwallet.rs b/lib/src/lightwallet.rs index fc45261..d5d3380 100644 --- a/lib/src/lightwallet.rs +++ b/lib/src/lightwallet.rs @@ -385,8 +385,8 @@ impl LightWallet { nonce: nonce, seed: seed_bytes, zkeys: Arc::new(RwLock::new(zkeys)), - tkeys: Arc::new(RwLock::new(tkeys)), - taddresses: Arc::new(RwLock::new(taddresses)), + tkeys: Arc::new(RwLock::new(vec![])), + taddresses: Arc::new(RwLock::new(vec![])), blocks: Arc::new(RwLock::new(blocks)), txs: Arc::new(RwLock::new(txs)), mempool_txs: Arc::new(RwLock::new(HashMap::new())), @@ -870,17 +870,17 @@ impl LightWallet { // Transparent keys let mut tkeys = vec![]; - for pos in 0..self.taddresses.read().unwrap().len() { - let sk = LightWallet::get_taddr_from_bip39seed(&self.config, &bip39_seed.as_bytes(), pos as u32); - let address = self.address_from_sk(&sk); - - if address != self.taddresses.read().unwrap()[pos] { - return Err(io::Error::new(ErrorKind::InvalidData, - format!("taddress mismatch at {}. {} vs {}", pos, address, self.taddresses.read().unwrap()[pos]))); - } - - tkeys.push(sk); - } + // for pos in 0..self.taddresses.read().unwrap().len() { + // let sk = LightWallet::get_taddr_from_bip39seed(&self.config, &bip39_seed.as_bytes(), pos as u32); + // let address = self.address_from_sk(&sk); + // + // if address != self.taddresses.read().unwrap()[pos] { + // return Err(io::Error::new(ErrorKind::InvalidData, + // format!("taddress mismatch at {}. {} vs {}", pos, address, self.taddresses.read().unwrap()[pos]))); + // } + // + // tkeys.push(sk); + // } // Go over the zkeys, and add the spending keys again self.zkeys.write().unwrap().iter_mut().map(|zk| { @@ -1158,7 +1158,7 @@ impl LightWallet { // If the wallet is locked, this is a no-op. That is fine, since we really // need to only add new addresses when restoring a new wallet, when it will not be locked. // Also, if it is locked, the user can't create new addresses anyway. - self.add_taddr(); + // self.add_taddr(); } } } diff --git a/lib/src/lightwallet/bugs.rs b/lib/src/lightwallet/bugs.rs index e005ef4..3775e5c 100644 --- a/lib/src/lightwallet/bugs.rs +++ b/lib/src/lightwallet/bugs.rs @@ -116,7 +116,7 @@ impl BugBip39Derivation { } for _ in 1..num_taddrs { - wallet.add_taddr(); + // wallet.add_taddr(); } let r = object!{