Skip to content

Commit

Permalink
Merge pull request #1641 from zcash/fix-accounts-uuid-migration-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom authored Dec 9, 2024
2 parents 3725313 + 5c404a3 commit e0f04e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions zcash_client_sqlite/src/wallet/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,8 @@ JOIN transactions
-- join to the sent_notes table to obtain `from_account_id`
LEFT JOIN sent_notes ON sent_notes.id = ro.sent_note_id
-- join on the accounts table to obtain account UUIDs
JOIN accounts from_account ON accounts.id = sent_notes.from_account_id
JOIN accounts to_account ON accounts.id = ro.account_id
JOIN accounts from_account ON from_account.id = sent_notes.from_account_id
JOIN accounts to_account ON to_account.id = ro.account_id
UNION
-- select all outputs sent from the wallet to external recipients
SELECT transactions.txid AS txid,
Expand All @@ -918,7 +918,7 @@ JOIN transactions
ON transactions.id_tx = sent_notes.tx
LEFT JOIN v_received_outputs ro ON ro.sent_note_id = sent_notes.id
-- join on the accounts table to obtain account UUIDs
JOIN accounts from_account ON accounts.id = sent_notes.from_account_id
JOIN accounts from_account ON from_account.id = sent_notes.from_account_id
-- exclude any sent notes for which a row exists in the v_received_outputs view
WHERE ro.account_id IS NULL";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ impl RusqliteMigration for Migration {
-- join to the sent_notes table to obtain `from_account_id`
LEFT JOIN sent_notes ON sent_notes.id = ro.sent_note_id
-- join on the accounts table to obtain account UUIDs
JOIN accounts from_account ON accounts.id = sent_notes.from_account_id
JOIN accounts to_account ON accounts.id = ro.account_id
JOIN accounts from_account ON from_account.id = sent_notes.from_account_id
JOIN accounts to_account ON to_account.id = ro.account_id
UNION
-- select all outputs sent from the wallet to external recipients
SELECT transactions.txid AS txid,
Expand All @@ -307,7 +307,7 @@ impl RusqliteMigration for Migration {
ON transactions.id_tx = sent_notes.tx
LEFT JOIN v_received_outputs ro ON ro.sent_note_id = sent_notes.id
-- join on the accounts table to obtain account UUIDs
JOIN accounts from_account ON accounts.id = sent_notes.from_account_id
JOIN accounts from_account ON from_account.id = sent_notes.from_account_id
-- exclude any sent notes for which a row exists in the v_received_outputs view
WHERE ro.account_id IS NULL",
)?;
Expand Down

0 comments on commit e0f04e6

Please sign in to comment.