Fix: incorrect query allowing change to show up in TX list.

Originally identified by @pacu on the iOS side. We paired up and fixed
and tested the query over there.
This commit is contained in:
Kevin Gorham 2020-09-23 11:14:49 -04:00
parent 928eac9af0
commit 8d8a1ae8a8
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
1 changed files with 4 additions and 3 deletions

View File

@ -280,9 +280,10 @@ interface TransactionDao {
ON transactions.id_tx = sent_notes.tx
LEFT JOIN blocks
ON transactions.block = blocks.height
WHERE ( transactions.raw IS NULL
AND received_notes.is_change != 1 )
OR ( transactions.raw IS NOT NULL )
/* we want all received txs except those that are change and all sent transactions (even those that haven't been mined yet). Note: every entry in the 'send_notes' table has a non-null value for 'address' */
WHERE ( sent_notes.address IS NULL
AND received_notes.is_change != 1 )
OR sent_notes.address IS NOT NULL
ORDER BY ( minedheight IS NOT NULL ),
minedheight DESC,
blocktimeinseconds DESC,