Skip to content

Commit

Permalink
zcash_client_sqlite: Once a note is determined to be change, don't re…
Browse files Browse the repository at this point in the history
…scind that determination.

This is a minimal and correct but incomplete fix for
#1571. Additional work to distinguish change outputs
is necessary to update existing wallets that have made an incorrect
change determination in the past.
  • Loading branch information
nuttycom committed Oct 23, 2024
1 parent 58e121f commit 215d4d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zcash_client_sqlite/src/wallet/orchard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub(crate) fn put_received_note<T: ReceivedOrchardOutput>(
rseed = :rseed,
nf = IFNULL(:nf, nf),
memo = IFNULL(:memo, memo),
is_change = IFNULL(:is_change, is_change),
is_change = MAX(:is_change, is_change),
commitment_tree_position = IFNULL(:commitment_tree_position, commitment_tree_position),
recipient_key_scope = :recipient_key_scope
RETURNING orchard_received_notes.id",
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/src/wallet/sapling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ pub(crate) fn put_received_note<T: ReceivedSaplingOutput>(
rcm = :rcm,
nf = IFNULL(:nf, nf),
memo = IFNULL(:memo, memo),
is_change = IFNULL(:is_change, is_change),
is_change = MAX(:is_change, is_change),
commitment_tree_position = IFNULL(:commitment_tree_position, commitment_tree_position),
recipient_key_scope = :recipient_key_scope
RETURNING sapling_received_notes.id",
Expand Down

0 comments on commit 215d4d9

Please sign in to comment.