summaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-12 13:02:47 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-12 13:02:59 +0200
commit26f72f8572cf0d04cd0da718d34dad4ba479289c (patch)
treecb17c8d2ef4d8313e1d2c9b2312541275b4b4487 /src/exchangedb/plugin_exchangedb_postgres.c
parentd4404cec14e632d94a4b3eca8b889c0c81f30b96 (diff)
downloadexchange-26f72f8572cf0d04cd0da718d34dad4ba479289c.tar.gz
exchange-26f72f8572cf0d04cd0da718d34dad4ba479289c.tar.bz2
exchange-26f72f8572cf0d04cd0da718d34dad4ba479289c.zip
fix refund handling: allow refund increases for the same coin
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 1dc58883..e3604ec0 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -986,6 +986,7 @@ postgres_get_session (void *cls)
",wire"
",coin_sig"
",deposit_serial_id"
+ ",done"
" FROM deposits"
" JOIN known_coins kc"
" USING (coin_pub)"
@@ -2178,7 +2179,7 @@ postgres_insert_withdraw_info (
return qs;
}
-#if 0
+#if 1
/* update reserve balance */
reserve.pub = collectable->reserve_pub;
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
@@ -4124,6 +4125,7 @@ add_coin_deposit (void *cls,
chc->have_deposit_or_melt = true;
deposit = GNUNET_new (struct TALER_EXCHANGEDB_DepositListEntry);
{
+ uint8_t done = 0;
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_RESULT_SPEC_AMOUNT ("amount_with_fee",
&deposit->amount_with_fee),
@@ -4149,6 +4151,8 @@ add_coin_deposit (void *cls,
&deposit->csig),
GNUNET_PQ_result_spec_uint64 ("deposit_serial_id",
&serial_id),
+ GNUNET_PQ_result_spec_auto_from_type ("done",
+ &done),
GNUNET_PQ_result_spec_end
};
@@ -4162,6 +4166,7 @@ add_coin_deposit (void *cls,
chc->failed = true;
return;
}
+ deposit->done = (0 != done);
}
tl = GNUNET_new (struct TALER_EXCHANGEDB_TransactionList);
tl->next = chc->head;