From 0f6970aefd151984196b33ec643a48ed0d193f32 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 25 Jul 2023 13:46:44 +0000 Subject: [PATCH] zcash_client_sqlite: Cache statement for `wallet::prune_nullifier_map` --- zcash_client_sqlite/src/wallet.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zcash_client_sqlite/src/wallet.rs b/zcash_client_sqlite/src/wallet.rs index 23704cdd3..c7fb373c7 100644 --- a/zcash_client_sqlite/src/wallet.rs +++ b/zcash_client_sqlite/src/wallet.rs @@ -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(()) }