zcash_client_sqlite: Cache statement for `wallet::prune_nullifier_map`

This commit is contained in:
Jack Grigg 2023-07-25 13:46:44 +00:00
parent e773cd3ed4
commit 0f6970aefd
1 changed files with 3 additions and 2 deletions

View File

@ -1474,12 +1474,13 @@ pub(crate) fn prune_nullifier_map(
conn: &rusqlite::Transaction<'_>,
block_height: BlockHeight,
) -> Result<(), SqliteClientError> {
conn.execute(
let mut stmt_delete_locators = conn.prepare_cached(
"DELETE FROM tx_locator_map
WHERE block_height < :block_height",
named_params![":block_height": u32::from(block_height)],
)?;
stmt_delete_locators.execute(named_params![":block_height": u32::from(block_height)])?;
Ok(())
}