File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
zcash_client_sqlite/src/wallet Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ fn per_protocol_names(protocol: ShieldedProtocol) -> (&'static str, &'static str
31
31
fn unscanned_tip_exists (
32
32
conn : & Connection ,
33
33
anchor_height : BlockHeight ,
34
- table_prefix : & str ,
34
+ table_prefix : & ' static str ,
35
35
) -> Result < bool , rusqlite:: Error > {
36
36
// v_sapling_shard_unscanned_ranges only returns ranges ending on or after wallet birthday, so
37
37
// we don't need to refer to the birthday in this query.
@@ -140,8 +140,6 @@ where
140
140
// 3) Select all notes for which the running sum was less than the required value, as
141
141
// well as a single note for which the sum was greater than or equal to the
142
142
// required value, bringing the sum of all selected notes across the threshold.
143
- //
144
- // 4) Match the selected notes against the witnesses at the desired height.
145
143
let mut stmt_select_notes = conn. prepare_cached (
146
144
& format ! (
147
145
"WITH eligible AS (
Original file line number Diff line number Diff line change @@ -140,6 +140,13 @@ fn to_spendable_note<P: consensus::Parameters>(
140
140
let ufvk_str: Option < String > = row. get ( 8 ) ?;
141
141
let scope_code: Option < i64 > = row. get ( 9 ) ?;
142
142
143
+ // If we don't have information about the recipient key scope or the ufvk we can't determine
144
+ // which spending key to use. This may be because the received note was associated with an
145
+ // imported viewing key, so we treat such notes as not spendable. Although this method is
146
+ // presently only called using the results of queries where both the ufvk and
147
+ // recipient_key_scope columns are checked to be non-null, this is method is written
148
+ // defensively to account for the fact that both of these are nullable columns in case it
149
+ // is used elsewhere in the future.
143
150
ufvk_str
144
151
. zip ( scope_code)
145
152
. map ( |( ufvk_str, scope_code) | {
@@ -176,10 +183,6 @@ fn to_spendable_note<P: consensus::Parameters>(
176
183
. transpose ( )
177
184
}
178
185
179
- // The `clippy::let_and_return` lint is explicitly allowed here because a bug in Clippy
180
- // (https://github.com/rust-lang/rust-clippy/issues/11308) means it fails to identify that the `result` temporary
181
- // is required in order to resolve the borrows involved in the `query_and_then` call.
182
- #[ allow( clippy:: let_and_return) ]
183
186
pub ( crate ) fn get_spendable_orchard_note < P : consensus:: Parameters > (
184
187
conn : & Connection ,
185
188
params : & P ,
You can’t perform that action at this time.
0 commit comments