Add confirmation depth to shield_funds

This commit is contained in:
Kris Nuttycombe 2021-02-12 19:09:54 -07:00
parent a3bc1e3e63
commit b88ee47e36
1 changed files with 3 additions and 1 deletions

View File

@ -266,6 +266,7 @@ where
}
#[cfg(feature = "transparent-inputs")]
#[allow(clippy::too_many_arguments)]
pub fn shield_funds<E, N, P, D, R>(
wallet_db: &mut D,
params: &P,
@ -274,6 +275,7 @@ pub fn shield_funds<E, N, P, D, R>(
sk: &secp256k1::SecretKey,
extsk: &ExtendedSpendingKey,
memo: &MemoBytes,
confirmations: u32,
) -> Result<D::TxRef, E>
where
E: From<Error<N>>,
@ -296,7 +298,7 @@ where
let ovk = exfvk.fvk.ovk;
// get UTXOs from DB
let utxos = wallet_db.get_unspent_transparent_utxos(&taddr, latest_anchor)?;
let utxos = wallet_db.get_unspent_transparent_utxos(&taddr, latest_anchor - confirmations)?;
let total_amount = utxos.iter().map(|utxo| utxo.value).sum::<Amount>();
let fee = DEFAULT_FEE;