Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tapdb: fix incorrect asset balances with mixed versions
Because of the versions field being in the GROUP BY clause of the query, we would get two distinct rows returned for the same asset ID if we had asset UTXOs with different versions. But because we use the asset ID as the map key of the data structure we return, only one of those two entries would be returned, causing the total amount to be incorrect. We fix this by removing the asset version field from the GROUP BY clause, resulting in just one row being returned. The alternative would be to add the version to the map key and show balances by asset ID and version instead.
- Loading branch information