summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_payback.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-08-19 16:01:57 +0200
committerChristian Grothoff <christian@grothoff.org>2018-08-19 16:01:57 +0200
commit0df2028f96f5977739d4659bf253e0c6d9468326 (patch)
tree906222af6c332e219af4a5d112891d7212237de3 /src/exchange/taler-exchange-httpd_payback.c
parentddca1f5c68e112928d715e1aee2758c40e14fb51 (diff)
downloadexchange-0df2028f96f5977739d4659bf253e0c6d9468326.tar.gz
exchange-0df2028f96f5977739d4659bf253e0c6d9468326.tar.bz2
exchange-0df2028f96f5977739d4659bf253e0c6d9468326.zip
make transactions smaller to try to reduce rollbacks
Diffstat (limited to 'src/exchange/taler-exchange-httpd_payback.c')
-rw-r--r--src/exchange/taler-exchange-httpd_payback.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_payback.c b/src/exchange/taler-exchange-httpd_payback.c
index 6f910b55b..aebbe2b82 100644
--- a/src/exchange/taler-exchange-httpd_payback.c
+++ b/src/exchange/taler-exchange-httpd_payback.c
@@ -391,6 +391,22 @@ verify_and_execute_payback (struct MHD_Connection *connection,
&pc.h_blind);
GNUNET_free (coin_ev);
+ /* make sure coin is 'known' in database */
+ {
+ struct TEH_DB_KnowCoinContext kcc;
+ int mhd_ret;
+
+ kcc.coin = coin;
+ kcc.connection = connection;
+ if (GNUNET_OK !=
+ TEH_DB_run_transaction (connection,
+ "know coin for payback",
+ &mhd_ret,
+ &TEH_DB_know_coin_transaction,
+ &kcc))
+ return mhd_ret;
+ }
+
pc.coin_sig = coin_sig;
pc.coin_bks = coin_bks;
pc.coin = coin;