diff --git a/zcash_extras/src/wallet.rs b/zcash_extras/src/wallet.rs index 0b14fb4cb0..63fbd72a7f 100644 --- a/zcash_extras/src/wallet.rs +++ b/zcash_extras/src/wallet.rs @@ -21,49 +21,6 @@ use zcash_client_backend::{ wallet::{AccountId, OvkPolicy}, }; -pub const ANCHOR_OFFSET: u32 = 10; - -/// Scans a [`Transaction`] for any information that can be decrypted by the accounts in -/// the wallet, and saves it to the wallet. -pub async fn decrypt_and_store_transaction( - params: &P, - data: &mut D, - tx: &Transaction, -) -> Result<(), E> -where - E: From>, - P: consensus::Parameters, - D: WalletWrite, -{ - // Fetch the ExtendedFullViewingKeys we are tracking - let extfvks = data.get_extended_full_viewing_keys().await?; - - // Height is block height for mined transactions, and the "mempool height" (chain height + 1) - // for mempool transactions. - let height = data - .get_tx_height(tx.txid()) - .await? - .or(data - .block_height_extrema() - .await? - .map(|(_, max_height)| max_height + 1)) - .or_else(|| params.activation_height(NetworkUpgrade::Sapling)) - .ok_or(Error::SaplingNotActive)?; - - let outputs = decrypt_transaction(params, height, tx, &extfvks); - if outputs.is_empty() { - Ok(()) - } else { - data.store_received_tx(&ReceivedTransaction { - tx, - outputs: &outputs, - }) - .await?; - - Ok(()) - } -} - #[allow(clippy::needless_doctest_main)] /// Creates a transaction paying the specified address from the given account. ///