From ff2e257f8e4e7a32b97b9b0b4805d87bc2d90583 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Fri, 11 Aug 2023 14:42:03 -0600 Subject: [PATCH] zcash_client_sqlite: Note selection requires commitment tree positions to be known. Fixes #895 --- zcash_client_sqlite/src/wallet/sapling.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zcash_client_sqlite/src/wallet/sapling.rs b/zcash_client_sqlite/src/wallet/sapling.rs index 1ea961fcb..2f22acac5 100644 --- a/zcash_client_sqlite/src/wallet/sapling.rs +++ b/zcash_client_sqlite/src/wallet/sapling.rs @@ -154,6 +154,7 @@ pub(crate) fn get_spendable_sapling_notes( FROM sapling_received_notes INNER JOIN transactions ON transactions.id_tx = sapling_received_notes.tx WHERE account = :account + AND commitment_tree_position IS NOT NULL AND spent IS NULL AND transactions.block <= :anchor_height AND id_note NOT IN rarray(:exclude) @@ -231,6 +232,7 @@ pub(crate) fn select_spendable_sapling_notes( INNER JOIN transactions ON transactions.id_tx = sapling_received_notes.tx WHERE account = :account + AND commitment_tree_position IS NOT NULL AND spent IS NULL AND transactions.block <= :anchor_height AND id_note NOT IN rarray(:exclude)