aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-07-06 18:36:51 +0200
committerChristian Grothoff <christian@grothoff.org>2022-07-06 18:36:51 +0200
commit0ad84355d59885eab6001cfaf96056c958680ab0 (patch)
treee82b99c299d84c2df95ffb75b41d3dc53d1e6766 /src/exchangedb/plugin_exchangedb_postgres.c
parent36a8ecd4c47eaaab767d679564aa4e87166fa361 (diff)
downloadexchange-0ad84355d59885eab6001cfaf96056c958680ab0.tar.xz
fix auditor refund fee calculations
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index b9debfa44..526db5646 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -1778,18 +1778,12 @@ prepare_statements (struct PostgresClosure *pg)
" FROM refunds"
" WHERE coin_pub IN (SELECT coin_pub FROM dep)"
" AND deposit_serial_id IN (SELECT deposit_serial_id FROM dep))"
- " ,coins_with_fees AS (" /* find coins for which deposit fees apply */
- " SELECT"
- " coin_pub"
- " ,deposit_serial_id" /* ensures that if the same coin is deposited twice, it is in the list twice */
- " FROM dep"
- " WHERE deposit_serial_id NOT IN (SELECT deposit_serial_id FROM ref))"
" ,fees AS (" /* find deposit fees for non-refunded deposits */
" SELECT"
" denom.fee_deposit_val AS fee_val"
" ,denom.fee_deposit_frac AS fee_frac"
" ,cs.deposit_serial_id" /* ensures we get the fee for each coin, not once per denomination */
- " FROM coins_with_fees cs"
+ " FROM dep cs"
" JOIN known_coins kc" /* NOTE: may do a full join on the master, maybe find a left-join way to integrate with query above to push it to the shards? */
" USING (coin_pub)"
" JOIN denominations denom"