diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-03-12 11:33:10 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-03-12 11:33:10 +0100 |
commit | a166ca7fece8bbe3c66dcf0217cc81d20d185ab0 (patch) | |
tree | b9cf10b1034e3f1d4d9c367ef2faa7e6bd206404 /src/exchange/taler-exchange-httpd_db.c | |
parent | 1ae2ba3d0a035734e4a28432e3246e58338fe9e8 (diff) | |
download | exchange-a166ca7fece8bbe3c66dcf0217cc81d20d185ab0.tar.gz exchange-a166ca7fece8bbe3c66dcf0217cc81d20d185ab0.tar.bz2 exchange-a166ca7fece8bbe3c66dcf0217cc81d20d185ab0.zip |
fix #5281 for exchange: do preflight check that an old transaction is no longer running by accident
Diffstat (limited to 'src/exchange/taler-exchange-httpd_db.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_db.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c index bd7777ce3..7817de990 100644 --- a/src/exchange/taler-exchange-httpd_db.c +++ b/src/exchange/taler-exchange-httpd_db.c @@ -41,6 +41,7 @@ * errors, generates an error message for @a connection. * * @param connection MHD connection to run @a cb for + * @param name name of the transaction (for debugging) * @param[out] set to MHD response code, if transaction failed * @param cb callback implementing transaction logic * @param cb_cls closure for @a cb, must be read-only! @@ -48,6 +49,7 @@ */ int TEH_DB_run_transaction (struct MHD_Connection *connection, + const char *name, int *mhd_ret, TEH_DB_TransactionCallback cb, void *cb_cls) @@ -64,13 +66,16 @@ TEH_DB_run_transaction (struct MHD_Connection *connection, TALER_EC_DB_SETUP_FAILED); return GNUNET_SYSERR; } + TEH_plugin->preflight (TEH_plugin->cls, + session); for (unsigned int retries = 0;retries < MAX_TRANSACTION_COMMIT_RETRIES; retries++) { enum GNUNET_DB_QueryStatus qs; if (GNUNET_OK != TEH_plugin->start (TEH_plugin->cls, - session)) + session, + name)) { GNUNET_break (0); if (NULL != mhd_ret) |