aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backenddb/pg_lookup_deposits_by_contract_and_coin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c b/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c
index 294ca39c..089543ea 100644
--- a/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c
+++ b/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c
@@ -266,6 +266,10 @@ TMH_PG_lookup_deposits_by_contract_and_coin (
"SELECT"
" refund_amount"
" FROM merchant_refunds"
+ /* Join to filter by refunds that actually
+ did work, not only those we approved */
+ " JOIN merchant_refund_proofs"
+ " USING (refund_serial)"
" WHERE coin_pub=$3"
" AND order_serial="
" (SELECT order_serial"