Skip to content

Commit

Permalink
remove decrypt_and_store_transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
borngraced committed Nov 2, 2023
1 parent cfbe0a0 commit faed2b8
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions zcash_extras/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<N, E, P, D>(
params: &P,
data: &mut D,
tx: &Transaction,
) -> Result<(), E>
where
E: From<Error<N>>,
P: consensus::Parameters,
D: WalletWrite<Error = E>,
{
// 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.
///
Expand Down

0 comments on commit faed2b8

Please sign in to comment.