Skip to content

Commit

Permalink
zcash_client_sqlite: allow zero-conf transactions in unshielded balance.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Sep 5, 2023
1 parent dfe6bae commit c29ac36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zcash_client_sqlite/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ pub(crate) fn get_wallet_summary(

#[cfg(feature = "transparent-inputs")]
{
let zero_conf_height = (chain_tip_height + 1).saturating_sub(min_confirmations);
let mut stmt_transparent_balances = conn.prepare(
"SELECT u.received_by_account, SUM(u.value_zat)
FROM utxos u
Expand All @@ -722,7 +723,7 @@ pub(crate) fn get_wallet_summary(
GROUP BY u.received_by_account",
)?;
let mut rows = stmt_transparent_balances
.query(named_params![":max_height": u32::from(summary_height)])?;
.query(named_params![":max_height": u32::from(zero_conf_height)])?;

while let Some(row) = rows.next()? {
let account = AccountId::from(row.get::<_, u32>(0)?);
Expand Down

0 comments on commit c29ac36

Please sign in to comment.